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: min_periods=None behavior for Rolling.count #36649

Merged
merged 20 commits into from
Oct 2, 2020

Conversation

mroeschke
Copy link
Member

@mroeschke mroeschke commented Sep 26, 2020

Additionally refactors count to take the _apply path to make this op consistent with the others.

@mroeschke mroeschke added Deprecate Functionality to remove in pandas Window rolling, ewma, expanding labels Sep 26, 2020
@mroeschke mroeschke added this to the 1.2 milestone Sep 26, 2020
"consistent with other methods in a future version. "
"Specify min_periods=0 instead."
),
DeprecationWarning,
Copy link
Contributor

Choose a reason for hiding this comment

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

make this a FutureWarning. I know its loud but i think we need to.

Copy link
Contributor

Choose a reason for hiding this comment

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

alt we could do this for a version and then change it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed to FutureWarning

@phofl
Copy link
Member

phofl commented Oct 1, 2020

This will close #35579 too.

You could use

def test_fixed_forward_indexer_count():
    # GH: 35579
    df = DataFrame({"b": [None, None, None, 7]})
    indexer = FixedForwardWindowIndexer(window_size=2)
    result = df.rolling(window=indexer, min_periods=0).count()
    expected = DataFrame({"b": [0.0, 0.0, 1.0, 1.0]})
    tm.assert_frame_equal(result, expected)

as a test.

@mroeschke
Copy link
Member Author

Thanks @phofl. Added that unit test to this PR

@jreback jreback merged commit 627da5a into pandas-dev:master Oct 2, 2020
@jreback
Copy link
Contributor

jreback commented Oct 2, 2020

thanks @mroeschke

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 Window rolling, ewma, expanding
Projects
None yet
4 participants