diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 23ada120505d5..8f6d666064d01 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -12042,7 +12042,7 @@ def min( @doc(Rolling) def rolling( self, - window: int | timedelta | BaseOffset | BaseIndexer, + window: int | timedelta | str | BaseOffset | BaseIndexer, min_periods: int | None = None, center: bool_t = False, win_type: str | None = None, diff --git a/pandas/core/window/rolling.py b/pandas/core/window/rolling.py index 3e44a5af02178..2abca7d182859 100644 --- a/pandas/core/window/rolling.py +++ b/pandas/core/window/rolling.py @@ -922,13 +922,13 @@ class Window(BaseWindow): Parameters ---------- - window : int, offset, or BaseIndexer subclass + window : int, timedelta, str, offset, or BaseIndexer subclass Size of the moving window. If an integer, the fixed number of observations used for each window. - If an offset, the time period of each window. Each + If a timedelta, str, or offset, the time period of each window. Each window will be a variable sized based on the observations included in the time-period. This is only valid for datetimelike indexes. To learn more about the offsets & frequency strings, please see `this link