From 9057afb0a9a076744a585335ee5cc8301aec43ec Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 2 Feb 2025 15:00:55 -0500 Subject: [PATCH 1/3] change docs --- pandas/core/groupby/groupby.py | 11 +++++++---- pandas/core/window/rolling.py | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index f9059e6e8896f..afd15208d51e4 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -3654,15 +3654,18 @@ def rolling( an integer index is not used to calculate the rolling window. closed : str, default None - If ``'right'``, the first point in the window is excluded from calculations. + Determines the inclusivity of points in the window + If ``'right'``, (First, Last] the last point in the window is included in the calculations. - If ``'left'``, the last point in the window is excluded from calculations. + If ``'left'``, [First, Last) the first point in the window is included in the calculations. - If ``'both'``, no points in the window are excluded from calculations. + If ``'both'``, [First, Last] all points in the window are included in the calculations. - If ``'neither'``, the first and last points in the window are excluded + If ``'neither'``, (First, Last) the first and last points in the window are excluded from calculations. + () and [] are referencing open and closed set notation respetively. + Default ``None`` (``'right'``). method : str {'single', 'table'}, default 'single' diff --git a/pandas/core/window/rolling.py b/pandas/core/window/rolling.py index 631ab15464942..9cf2d42ac37a8 100644 --- a/pandas/core/window/rolling.py +++ b/pandas/core/window/rolling.py @@ -929,15 +929,18 @@ class Window(BaseWindow): an integer index is not used to calculate the rolling window. closed : str, default None - If ``'right'``, the first point in the window is excluded from calculations. + Determines the inclusivity of points in the window + If ``'right'``, (First, Last] the last point in the window is included in the calculations. - If ``'left'``, the last point in the window is excluded from calculations. + If ``'left'``, [First, Last) the first point in the window is included in the calculations. - If ``'both'``, no point in the window is excluded from calculations. + If ``'both'``, [First, Last] all points in the window are included in the calculations. - If ``'neither'``, the first and last points in the window are excluded + If ``'neither'``, (First, Last) the first and last points in the window are excluded from calculations. + () and [] are referencing open and closed set notation respetively. + Default ``None`` (``'right'``). step : int, default None From c3d9cc080ff0564e90aacb6007e40d2631f19b11 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 2 Feb 2025 15:06:21 -0500 Subject: [PATCH 2/3] format --- pandas/core/groupby/groupby.py | 20 ++++++++++++-------- pandas/core/window/rolling.py | 20 ++++++++++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index afd15208d51e4..e1446d7edc4da 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -3654,18 +3654,22 @@ def rolling( an integer index is not used to calculate the rolling window. closed : str, default None - Determines the inclusivity of points in the window - If ``'right'``, (First, Last] the last point in the window is included in the calculations. + Determines the inclusivity of points in the window + If ``'right'``, (First, Last] the last point in the window + is included in the calculations. - If ``'left'``, [First, Last) the first point in the window is included in the calculations. + If ``'left'``, [First, Last) the first point in the window + is included in the calculations. - If ``'both'``, [First, Last] all points in the window are included in the calculations. + If ``'both'``, [First, Last] all points in the window + are included in the calculations. - If ``'neither'``, (First, Last) the first and last points in the window are excluded - from calculations. + If ``'neither'``, (First, Last) the first and last points + in the window are excludedfrom calculations. + + () and [] are referencing open and closed set + notation respetively. - () and [] are referencing open and closed set notation respetively. - Default ``None`` (``'right'``). method : str {'single', 'table'}, default 'single' diff --git a/pandas/core/window/rolling.py b/pandas/core/window/rolling.py index 9cf2d42ac37a8..9f67c2b36520c 100644 --- a/pandas/core/window/rolling.py +++ b/pandas/core/window/rolling.py @@ -929,18 +929,22 @@ class Window(BaseWindow): an integer index is not used to calculate the rolling window. closed : str, default None - Determines the inclusivity of points in the window - If ``'right'``, (First, Last] the last point in the window is included in the calculations. + Determines the inclusivity of points in the window + If ``'right'``, (First, Last] the last point in the window + is included in the calculations. - If ``'left'``, [First, Last) the first point in the window is included in the calculations. + If ``'left'``, [First, Last) the first point in the window + is included in the calculations. - If ``'both'``, [First, Last] all points in the window are included in the calculations. + If ``'both'``, [First, Last] all points in the window + are included in the calculations. - If ``'neither'``, (First, Last) the first and last points in the window are excluded - from calculations. + If ``'neither'``, (First, Last) the first and last points + in the window are excludedfrom calculations. + + () and [] are referencing open and closed set + notation respetively. - () and [] are referencing open and closed set notation respetively. - Default ``None`` (``'right'``). step : int, default None From 6684f34202d358ab5fb835da980a18fb2e2d38d1 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sun, 2 Feb 2025 15:10:49 -0500 Subject: [PATCH 3/3] format --- pandas/core/groupby/groupby.py | 8 ++++---- pandas/core/window/rolling.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index e1446d7edc4da..8515a8229dea9 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -3658,16 +3658,16 @@ def rolling( If ``'right'``, (First, Last] the last point in the window is included in the calculations. - If ``'left'``, [First, Last) the first point in the window + If ``'left'``, [First, Last) the first point in the window is included in the calculations. - If ``'both'``, [First, Last] all points in the window + If ``'both'``, [First, Last] all points in the window are included in the calculations. - If ``'neither'``, (First, Last) the first and last points + If ``'neither'``, (First, Last) the first and last points in the window are excludedfrom calculations. - () and [] are referencing open and closed set + () and [] are referencing open and closed set notation respetively. Default ``None`` (``'right'``). diff --git a/pandas/core/window/rolling.py b/pandas/core/window/rolling.py index 9f67c2b36520c..b954ce2584c13 100644 --- a/pandas/core/window/rolling.py +++ b/pandas/core/window/rolling.py @@ -933,16 +933,16 @@ class Window(BaseWindow): If ``'right'``, (First, Last] the last point in the window is included in the calculations. - If ``'left'``, [First, Last) the first point in the window + If ``'left'``, [First, Last) the first point in the window is included in the calculations. - If ``'both'``, [First, Last] all points in the window + If ``'both'``, [First, Last] all points in the window are included in the calculations. - If ``'neither'``, (First, Last) the first and last points + If ``'neither'``, (First, Last) the first and last points in the window are excludedfrom calculations. - () and [] are referencing open and closed set + () and [] are referencing open and closed set notation respetively. Default ``None`` (``'right'``).