Index.rolling(window, min_periods=None, center=False, win_type=None, axis=_NoDefault.no_default)

Provides rolling transformations.

windowint, str, offset

Size of the moving window. This is the number of observations used for calculating the statistic. When not using a DatetimeIndex, the window size must not be so large as to span more than one adjacent partition. If using an offset or offset alias like ‘5D’, the data must have a DatetimeIndex

Changed in version 0.15.0: Now accepts offsets and string offset aliases

min_periodsint, default None

Minimum number of observations in window required to have a value (otherwise result is NA).

centerboolean, default False

Set the labels at the center of the window.

win_typestring, default None

Provide a window type. The recognized window types are identical to pandas.

axisint, str, None, default 0

This parameter is deprecated with pandas>=2.1.

a Rolling object on which to call a method to compute a statistic