-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
ENH: Add numeric_only to certain groupby ops #46728
Conversation
…numeric_only_gb � Conflicts: � pandas/core/frame.py � pandas/core/groupby/generic.py � pandas/core/shared_docs.py
…numeric_only_gb
…andas into add_numeric_only_gb
…numeric_only_gb � Conflicts: � doc/source/whatsnew/v1.5.0.rst
5620a69
to
8e435ab
Compare
…numeric_only_gb
@jreback - gentle ping. |
pandas/core/groupby/groupby.py
Outdated
else: | ||
nonnumeric_exclusions = frozenset() | ||
with com.temp_setattr( | ||
self, "exclusions", self.exclusions | nonnumeric_exclusions |
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.
what is the purpose here?
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.
Thanks - I was able to remove this hack by setting the appropriate value of raise_on_typeerror.
…numeric_only_gb
…numeric_only_gb � Conflicts: � doc/source/whatsnew/v1.5.0.rst
thanks @rhshadrach very nice! |
Part of #46560
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.For the ops that have numeric_only added, we have the option of dropping nuisance columns even when
numeric_only=False
is specified to be consistent with other groupby ops (e.g. sum). I decided to implement the correct behavior here instead; this required adding an argument to the cython/python paths. This argument can be removed in 2.0 when all ops would raise.