-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Enable .mode to sort with NA values #60702
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
Conversation
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.
LGTM!
lgtm as well. I see marked for 2.3 but should this not wait until 3? |
This is fixing an inconsistency between str dtypes, which is why I think we'd want it in 2.3. I am comfortable calling this inconsistency a bug. Do you think it is too breaking of a change? |
Ah OK - that makes sense for 2.3 then. Can you take this out of draft mode? |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
I put it in draft mode because it wasn't ready to merge - needs a what's new. No worries at all here, can do a followup, but just as a general ways of working can I request not having others take my PRs out of draft. |
Sure no problem |
(cherry picked from commit 1708e90)
Manual backport -> #60754 |
…60754) (cherry picked from commit 1708e90) Co-authored-by: Richard Shadrach <[email protected]>
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.We sort values in groupby with NAs using
safe_sort
, we can do the same for mode. This resolves an inconsistency between Python and PyArrow backed strings as PyArrow's mode can sort the NA values.The other option here is to not sort the result in all cases. This would be my preference as users can sort the result if they like but they cannot unsort it. But it would be a breaking change.
cc @WillAyd @jorisvandenbossche @mroeschke