-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
MNT: Bump dev pin on NumPy #60987
base: main
Are you sure you want to change the base?
MNT: Bump dev pin on NumPy #60987
Conversation
@@ -2063,6 +2063,7 @@ or a passed ``Series``), then it will be preserved in DataFrame operations. Furt | |||
different numeric dtypes will **NOT** be combined. The following example will give you a taste. | |||
|
|||
.. ipython:: python | |||
:okwarning: |
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.
Opened #61029
>>> s.argmax() | ||
2 | ||
np.int64(2) | ||
>>> s.argmin() | ||
0 |
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.
There are a few of these where I'm wondering if we should be returning Python scalars instead of NumPy. Should issues be opened for these?
cc @pandas-dev/pandas-core
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 think generally we always want to return Python scalars (IIRC we got a lot of issues about this in iteration and iteration-like APIs in the past)
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.
Even just wrapping the result of Series._reduce
with maybe_box_naive
breaks 692 tests. From a cursory look, they're tests that are expecting a NumPy scalar back. A lot however are something like op(data).any().any()
so that they will work with DataFrame and Series. I plan to bring this up in the next dev meeting.
@@ -415,7 +415,7 @@ def unique(values): | |||
|
|||
>>> pd.unique(pd.array([1 + 1j, 2, 3])) | |||
<NumpyExtensionArray> | |||
[(1+1j), (2+0j), (3+0j)] | |||
[np.complex128(1+1j), np.complex128(2+0j), np.complex128(3+0j)] |
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 merged #54268 a while back to make these reprs render like the Python scalars/pre numpy 2.0. It appears that PR didn't touch all the relevant repr methods
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'll do a precursor to fix the reprs for arrays, and then revert some of the outputs here.
Your comment only applies to EA reprs?
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 would say any repr in pandas shouldn't be showing the NEP 51 style repr for scalars.
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.