modin.pandas.Rolling.countΒΆ
- Rolling.count(numeric_only: bool = False)[source]ΒΆ
Compute the rolling count.
- Parameters:
numeric_only (bool, default False) β Include only float, int, boolean columns.
*args (tuple) β Positional arguments to pass to func.
**kwargs (dict) β Keyword arguments to be passed into func.
- Returns:
Computed rolling count of values.
- Return type:
Examples
>>> df = pd.DataFrame({'B': [0, 1, 2, np.nan, 4]}) >>> df B 0 0.0 1 1.0 2 2.0 3 NaN 4 4.0 >>> df.rolling(2, min_periods=1).count() B 0 1 1 2 2 2 3 1 4 1 >>> df.rolling(2, min_periods=2).count() B 0 NaN 1 2.0 2 2.0 3 1.0 4 1.0 >>> df.rolling(3, min_periods=1, center=True).count() B 0 2 1 3 2 2 3 2 4 1