diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 27865a60f6ea3..d0c0ed29b6d44 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -3659,10 +3659,10 @@ def rolling( Parameters ---------- window : int, timedelta, str, offset, or BaseIndexer subclass - Size of the moving window. + Interval of the moving window. - If an integer, the fixed number of observations used for - each window. + If an integer, the delta between the start and end of each window. + The number of points in the window depends on the ``closed`` argument. 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 @@ -3709,17 +3709,18 @@ def rolling( closed : str, default None Determines the inclusivity of points in the window - If ``'right'``, (First, Last] the last point in the window + + If ``'right'``, uses the window (first, last] meaning the last point is included in the calculations. - If ``'left'``, [First, Last) the first point in the window + If ``'left'``, uses the window [first, last) meaning the first point is included in the calculations. - If ``'both'``, [First, Last] all points in the window - are included in the calculations. + If ``'both'``, uses the window [first, last] meaning all points in + the window are included in the calculations. - If ``'neither'``, (First, Last) the first and last points - in the window are excludedfrom calculations. + If ``'neither'``, uses the window (first, last) meaning the first + and last points in the window are excluded from calculations. () and [] are referencing open and closed set notation respetively. diff --git a/pandas/core/window/rolling.py b/pandas/core/window/rolling.py index b954ce2584c13..69fce8cf2137e 100644 --- a/pandas/core/window/rolling.py +++ b/pandas/core/window/rolling.py @@ -881,10 +881,10 @@ class Window(BaseWindow): Parameters ---------- window : int, timedelta, str, offset, or BaseIndexer subclass - Size of the moving window. + Interval of the moving window. - If an integer, the fixed number of observations used for - each window. + If an integer, the delta between the start and end of each window. + The number of points in the window depends on the ``closed`` argument. 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 @@ -930,17 +930,18 @@ class Window(BaseWindow): closed : str, default None Determines the inclusivity of points in the window - If ``'right'``, (First, Last] the last point in the window + + If ``'right'``, uses the window (first, last] meaning the last point is included in the calculations. - If ``'left'``, [First, Last) the first point in the window + If ``'left'``, uses the window [first, last) meaning the first point is included in the calculations. - If ``'both'``, [First, Last] all points in the window - are included in the calculations. + If ``'both'``, uses the window [first, last] meaning all points in + the window are included in the calculations. - If ``'neither'``, (First, Last) the first and last points - in the window are excludedfrom calculations. + If ``'neither'``, uses the window (first, last) meaning the first + and last points in the window are excluded from calculations. () and [] are referencing open and closed set notation respetively.