From 17fd1d7872c66c53f850c61b39c94590103d021b Mon Sep 17 00:00:00 2001 From: Siddhartha Gandhi Date: Fri, 14 Oct 2022 17:00:23 -0400 Subject: [PATCH] Update documentation for window parameter of rolling() to account for all possible data types --- pandas/core/generic.py | 2 +- pandas/core/window/rolling.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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