pandas.core.window.expanding.Expanding.count — pandas 2.2.3 documentation (original) (raw)
Expanding.count(numeric_only=False)[source]#
Calculate the expanding count of non NaN observations.
Returns:
Series or DataFrame
Return type is the same as the original object with np.float64
dtype.
Examples
ser = pd.Series([1, 2, 3, 4], index=['a', 'b', 'c', 'd']) ser.expanding().count() a 1.0 b 2.0 c 3.0 d 4.0 dtype: float64