-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
Description
-
I have checked that this issue has not already been reported.
-
I have confirmed this bug exists on the latest version of pandas.
-
(optional) I have confirmed this bug exists on the master branch of pandas.
Per the documentation:
For a window that is specified by an offset, min_periods will default to 1. Otherwise, min_periods will default to the size of the window.
Therefore these two statements should be equal
In [4]: pd.__version__
Out[4]: '1.2.0.dev0+160.gd90b73bde'
In [5]: pd.Series([np.nan] * 4).rolling(2).count()
Out[5]:
0 0.0
1 0.0
2 0.0
3 0.0
dtype: float64
In [6]: pd.Series([np.nan] * 4).rolling(2, min_periods=2).count()
Out[6]:
0 NaN
1 0.0
2 0.0
3 0.0
dtype: float64