-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPR: numeric_only default in resampler ops #47177
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
pandas/core/resample.py
Outdated
@@ -937,25 +936,27 @@ def asfreq(self, fill_value=None): | |||
""" | |||
return self._upsample("asfreq", fill_value=fill_value) | |||
|
|||
def std(self, ddof=1, *args, **kwargs): | |||
def std(self, ddof=1, numeric_only: bool = False): |
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.
@mroeschke - I believe you've done a bunch of work in resample/window; do you know why args/kwargs exist on these ops? They seem to be on all these methods only to check that the user didn't pass anything to them. I'm going to revert these removals here, but was thinking about doing a cleanup of these in a separate PR if they aren't useful. Checking the history here, there is some indication of compatibility with numpy in #12810, but I don't understand it.
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 the numpy compatibility was such that one could call e.g. np.mean(df.groupby/resample/rolling)
and get the equivalent call to df.groupby/resample/rolling.mean()
. Not sure why that compatibility was desired or if it was widely tested (guessing not if tests are passing).
FWIW I think I broke this compatibility too when I added engine keywords to the window and groupby reduction ops, so I'd be +1 to clean these *args, **kwargs
thanks @rhshadrach |
Part of #46560
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.