expanding(min_periods=N).count(), for any N, returns same result as expanding(min_periods=1).count()
See original GitHub issueidx=pd.date_range('1/1/2019', periods=5)
s = pd.Series([2,3, np.nan, 10,20], index=idx)
s.expanding(min_periods=1).count()
s.expanding(min_periods=100).count()
s.expanding(min_periods=10000).count()
Problem description
They should not be returning the same results because the Series has only 5 records.
Note: We receive a lot of issues on our GitHub tracker, so it is very possible that your issue has been posted before. Please check first before submitting so that we do not have to handle and close duplicates!
Note: Many problems can be resolved by simply upgrading pandas
to the latest version. Before submitting, please check if that solution works for you. If possible, you may want to check if master
addresses this issue, but that is not necessary.
For documentation-related issues, you can check the latest versions of the docs on master
here:
https://pandas-docs.github.io/pandas-docs-travis/
If the issue has not been resolved there, go ahead and file it in the issue tracker.
Expected Output
Output of pd.show_versions()
[paste the output of pd.show_versions()
here below this line]
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (7 by maintainers)
That test isn’t exactly the same. For this issue, we need a test where
min_periods
> number of elements in the seriestake