-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Remove usage of recarray #26687
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove usage of recarray #26687
Conversation
75186cd
to
d4599b4
Compare
# `pandas.DataFrame`. Matplotlib allows you to provide the ``data`` keyword argument | ||
# and generate plots passing the strings corresponding to the *x* and *y* variables. | ||
# | ||
# .. _structured numpy array: https://numpy.org/doc/stable/user/basics.rec.html#structured-arrays |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link is in-lined above and causing a flake8 flag
# .. _structured numpy array: https://numpy.org/doc/stable/user/basics.rec.html#structured-arrays |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(alternatively we could add this file to the flake8 config ignores)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to except the whole file from flake8. That's why I've inlined the links. Alternatively, we could use an inline comment # noqa: E501
on the links, which we generally don't do, but seems ok in this case.
Note, it's spelled 'supersedes', but also, it's not one of the valid keywords if that's what you were intending. |
This always gets me, too, though I tend to think it should be spelled "supercedes" as in "cause the other one to cede to it"... or as opposed to "precede" etc. |
d4599b4
to
23ed61b
Compare
|
||
# Highlight gaps in daily data | ||
gaps = np.flatnonzero(np.diff(r.date) > np.timedelta64(1, 'D')) | ||
gaps = np.flatnonzero(np.diff(r["date"]) > np.timedelta64(1, 'D')) | ||
for gap in r[['date', 'adj_close']][np.stack((gaps, gaps + 1)).T]: | ||
ax1.plot(gap.date, gap.adj_close, 'w--', lw=2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is a copy of r
that hasn't been changed.
ax1.plot(gap.date, gap.adj_close, 'w--', lw=2) | |
ax1.plot(gap['date'], gap['adj_close'], 'w--', lw=2) |
23ed61b
to
c3f72c5
Compare
Structured numpy arrays are more fundamental than recarrays and sufficient in all cases. Supersedes matplotlib#26664.
c3f72c5
to
4c14bd0
Compare
…687-on-v3.8.x Backport PR #26687 on branch v3.8.x (Remove usage of recarray)
Structured numpy arrays are more fundamental than recarrays and sufficient in all cases.
Superseeds #26664.