Skip to content

REGR: Rolling.count setting min_periods after call #39604

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 3 commits into from
Feb 5, 2021

Conversation

mroeschke
Copy link
Member

@mroeschke mroeschke added Window rolling, ewma, expanding Regression Functionality that used to work in a prior pandas version labels Feb 5, 2021
@mroeschke mroeschke added this to the 1.2.2 milestone Feb 5, 2021
@@ -1437,7 +1437,11 @@ def count(self):
FutureWarning,
)
self.min_periods = 0
return super().count()
result = super().count()
Copy link
Contributor

Choose a reason for hiding this comment

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

grr this is not pretty. maybe have a _count() method where you can pass min_periods? (for 1.2.2 this is prob ok, but for 1.3)

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm either is a shim that will be removed in 2.0. I think in either way I'll have to do this gymnastics since min_periods is set globally on the object

Copy link
Contributor

Choose a reason for hiding this comment

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

ok for here, I was talking about a _count() (private method) that we could pass thru min_periods

@jreback jreback merged commit d558bce into pandas-dev:master Feb 5, 2021
@jreback
Copy link
Contributor

jreback commented Feb 5, 2021

@meeseeksdev backport 1.2.x

@jreback
Copy link
Contributor

jreback commented Feb 5, 2021

thanks @mroeschke

@lumberbot-app

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Regression Functionality that used to work in a prior pandas version Window rolling, ewma, expanding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Rolling.count modifies 'min_periods' inplace since 1.2.0
3 participants