-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
REGR: groupby.idxmin/idxmax wrong result on extreme values #57046
Conversation
|
||
|
||
@pytest.mark.parametrize("how", ["idxmin", "idxmax"]) | ||
@pytest.mark.parametrize("dtype", ["float32", "float64"]) |
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.
float_numpy_dtype
fixture please
print(df) | ||
print(result) |
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.
print(df) | |
print(result) |
@@ -424,6 +424,7 @@ def _call_cython_op( | |||
mask=mask, | |||
result_mask=result_mask, | |||
is_datetimelike=is_datetimelike, | |||
**kwargs, |
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.
Why is kwargs needed here?
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.
To pass skipna to group_idxmin_idxmax
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.
Ah OK and I guess not all these accept skipna (IIRC there was that related issue related skipna
, but forgot if it was for groupby ops or not)
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.
Yea - I'm planning on turning #56939 into a tracking issue on adding skipna consistently throughout groupby. Can include removing these kwargs as part of that.
…ndas into reg_groupby_idxmin
# Conflicts: # doc/source/whatsnew/v2.2.1.rst
Thanks @rhshadrach |
…t on extreme values
… result on extreme values) (#57086) Backport PR #57046: REGR: groupby.idxmin/idxmax wrong result on extreme values Co-authored-by: Richard Shadrach <[email protected]>
…v#57046) * WIP * REGR: groupby.idxmin/idxmax wrong result on extreme values * fixes * NumPy 2.0 can't come soon enough * fixup * fixup
idxmax
groupby aggregation on uint column #57040 (Replace xxxx with the GitHub issue number)doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.While working on this, I noticed that the
skipna
argument was also being ignored.The only way I see solving this is adding a
seen
Boolean array instead of the sentinel values. cc @WillAyd