Skip to content
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

DEPR: numeric_only default in resampler ops #47177

Merged
merged 3 commits into from
Jun 5, 2022

Conversation

rhshadrach
Copy link
Member

Part of #46560

@rhshadrach rhshadrach added Resample resample method Deprecate Functionality to remove in pandas Nuisance Columns Identifying/Dropping nuisance columns in reductions, groupby.add, DataFrame.apply labels May 30, 2022
@rhshadrach rhshadrach added this to the 1.5 milestone May 30, 2022
@@ -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):
Copy link
Member Author

@rhshadrach rhshadrach Jun 4, 2022

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.

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 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

@rhshadrach rhshadrach mentioned this pull request Jun 4, 2022
9 tasks
@rhshadrach rhshadrach marked this pull request as draft June 4, 2022 13:12
@rhshadrach rhshadrach marked this pull request as ready for review June 4, 2022 15:18
@jreback jreback merged commit 62b6d25 into pandas-dev:main Jun 5, 2022
@jreback
Copy link
Contributor

jreback commented Jun 5, 2022

thanks @rhshadrach

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 Nuisance Columns Identifying/Dropping nuisance columns in reductions, groupby.add, DataFrame.apply Resample resample method
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants