Calculate the expanding Fisher’s definition of kurtosis without bias.
Include only float, int, boolean columns.
Added in version 1.5.0.
Return type is the same as the original object with np.float64 dtype.
See also
scipy.stats.kurtosisReference SciPy method.
pandas.Series.expandingCalling expanding with Series data.
pandas.DataFrame.expandingCalling expanding with DataFrames.
pandas.Series.kurtAggregating kurt for Series.
pandas.DataFrame.kurtAggregating kurt for DataFrame.
Notes
A minimum of four periods is required for the calculation.
Examples
The example below will show a rolling calculation with a window size of four matching the equivalent function call using scipy.stats.
>>> arr = [1, 2, 3, 4, 999]
>>> import scipy.stats
>>> print(f"{scipy.stats.kurtosis(arr[:-1], bias=False):.6f}")
-1.200000
>>> print(f"{scipy.stats.kurtosis(arr, bias=False):.6f}")
4.999874
>>> s = pd.Series(arr)
>>> s.expanding(4).kurt()
0 NaN
1 NaN
2 NaN
3 -1.200000
4 4.999874
dtype: float64
© 2008–2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
© 2011–2025, Open source contributors
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/2.3.0/reference/api/pandas.core.window.expanding.Expanding.kurt.html