-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPR: DataFrame.groupby(axis=1) #51395
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, just a thought about the docs. Also, are we good with targeting this for 2.1?
) | ||
df.groupby(axis=1, level=1).sum() | ||
).T | ||
df.groupby(level=1).sum() |
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 this whole example can also be removed; it started as DataFrame.sum
with level=1
passed which used groupby under the hood, making the unused categories show up (observed=False is the default). Now level
is not an argument do DataFrame.sum
, and so the docs here are not correct - unused categories don't show up in DataFrame.sum
.
Groupby is shown in the next example, which I think is sufficient.
But potentially removing this example would also be okay for a different PR.
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.
But potentially removing this example would also be okay for a different PR.
I'd like to punt on this for now, yah
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; assuming no opposition is voiced to the deprecation I plan to merge this Tuesday
Any more thoughts here? |
@jbrockmendel - thanks for the ping; just a conflict with the whatsnew. |
Thanks @jbrockmendel |
nb the 2.1.0 docs at https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.groupby.html do not mention this depreciation |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.