-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
TST(string dtype): Resolve xfail when grouping by nan column #60712
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
I think what is being tested here took advantage of the old implementation, giving |
Thanks @rhshadrach |
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. |
…dev#60712) (cherry picked from commit 55a6d0a)
Backport PR: #60719 |
I do think that on the short term, we should maybe keep supporting There are similar tests with pivot or stack/unstack where we also refer to a column/index label with |
One of the problems with doing that I think would be breaking usability between the |
For all dtypes? Or just I'm a bit resistant to changing groupby behavior here. This seems to me to be quite an edge case, and is long standing behavior for other dtypes. E.g. df = pd.DataFrame([[1, 1, 2], [3, 4, 5]], columns=pd.Index([1, pd.NA, 2], dtype="Int64"))
gb = df.groupby([None]) raises. |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.At first glance the behavior perhaps seems odd, but I think have to go with it while we infer dtype based on the non-NA values and accept
None
as an NA value for the inferred dtype. Namely, inthe columns are
[None, "b", "c"]
and so we infer this as strings withNone
being the corresponding NA-value, in this casenp.nan
. Thus we need to groupbynp.nan
.