Skip to content

Commit

Permalink
DOC: Closed parameter not intuitively documented in DataFrame.rolling (
Browse files Browse the repository at this point in the history
…#60832)

* change docs

* format

* format
  • Loading branch information
SebastianOuslis authored Feb 3, 2025
1 parent 3bd27ff commit c6fc6d0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
17 changes: 12 additions & 5 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -3717,14 +3717,21 @@ 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
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.
Default ``None`` (``'right'``).
Expand Down
17 changes: 12 additions & 5 deletions pandas/core/window/rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -929,14 +929,21 @@ 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
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.
Default ``None`` (``'right'``).
Expand Down

0 comments on commit c6fc6d0

Please sign in to comment.