Skip to content

DEPR: numeic_only in Series and SeriesGroupBy consistency #47561

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

Merged
merged 2 commits into from
Jul 5, 2022

Conversation

rhshadrach
Copy link
Member

@rhshadrach rhshadrach commented Jul 1, 2022

Part of #47500

Behavior changes are to functions which gained the numeric_only argument in 1.5.

@rhshadrach rhshadrach added Resample resample method Deprecate Functionality to remove in pandas Series Series data structure Nuisance Columns Identifying/Dropping nuisance columns in reductions, groupby.add, DataFrame.apply labels Jul 1, 2022
@rhshadrach rhshadrach added this to the 1.5 milestone Jul 1, 2022
@rhshadrach rhshadrach requested a review from mroeschke July 1, 2022 03:08
Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the Series.rolling aggregations functions already align with the change in this PR as well?

@rhshadrach
Copy link
Member Author

rhshadrach commented Jul 2, 2022

Thanks @mroeschke - running

ser = Series([0, 0, 1], dtype=object)
res = ser.rolling(2).sum(numeric_only=True)
print(res)

On 1.4.x, this succeeds and gives the same result as when dtype=int. On main, it raises NotImplementedError: Rolling.sum does not implement numeric_only. This PR exhibits the same behavior as main. I'll investigate this and do a followup to replace the breaking change with a deprecation.

I've changed the OP here so that the issue isn't closed.

@mroeschke mroeschke merged commit 37d0194 into pandas-dev:main Jul 5, 2022
@mroeschke
Copy link
Member

Great, thanks @rhshadrach

@rhshadrach rhshadrach deleted the numeric_only_ndim_1 branch July 6, 2022 22:14
yehoshuadimarsky pushed a commit to yehoshuadimarsky/pandas that referenced this pull request Jul 13, 2022
…#47561)

* DEPR: numeic_only in Series and SeriesGroupBy consistency

* Refactor warning, whatsnew note, fixup tests
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 Series Series data structure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants