Skip to content

DOC: groupby Automatic exclusion of “nuisance” columns #46415

Closed
@arnaudlegout

Description

@arnaudlegout

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

https://pandas.pydata.org/pandas-docs/stable/user_guide/groupby.html#automatic-exclusion-of-nuisance-columns

Documentation problem

Since pandas 1.3 silently removing nuisance columns in DataFrame groupby is deprecated.
https://pandas.pydata.org/docs/whatsnew/v1.3.0.html#deprecated-dropping-nuisance-columns-in-dataframe-reductions-and-dataframegroupby-operations

However, the current documentation of groupby still present the exclusion of nuisance columns as a feature.
https://pandas.pydata.org/pandas-docs/stable/user_guide/groupby.html#automatic-exclusion-of-nuisance-columns

Suggested fix for documentation

It should be clearly explained in the documentation that the user should pass the argument numeric_only=True to drop explicitly non-numeric or boolean columns, and that the silent drop of nuisance columns is deprecated and will raise in the future.

Metadata

Metadata

Assignees

Labels

DocsGroupbyNuisance ColumnsIdentifying/Dropping nuisance columns in reductions, groupby.add, DataFrame.apply

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions