Skip to content

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

Merged
merged 12 commits into from
Mar 4, 2023
Merged

Conversation

jbrockmendel
Copy link
Member

Copy link
Member

@rhshadrach rhshadrach left a 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()
Copy link
Member

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.

Copy link
Member Author

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

@simonjayhawkins simonjayhawkins added Groupby Deprecate Functionality to remove in pandas labels Feb 22, 2023
Copy link
Member

@rhshadrach rhshadrach left a 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

@rhshadrach rhshadrach added this to the 2.1 milestone Feb 26, 2023
@jbrockmendel
Copy link
Member Author

Any more thoughts here?

@rhshadrach
Copy link
Member

@jbrockmendel - thanks for the ping; just a conflict with the whatsnew.

@rhshadrach rhshadrach merged commit b391397 into pandas-dev:main Mar 4, 2023
@rhshadrach
Copy link
Member

Thanks @jbrockmendel

@cfaaron
Copy link

cfaaron commented Aug 30, 2023

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

@rhshadrach
Copy link
Member

Thanks @cfaaron - I've opened #54873.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas Groupby
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DEPR: DataFrame.groupby(axis=1)
4 participants