Closed
Description
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
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.