Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: Closed parameter not intuitively documented in DataFrame.rolling Part 2 The Window Strikes Back #60844

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
6 changes: 3 additions & 3 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about adding "The number of points in the window depends on the closed argument".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it, though I do think it would require a proper understanding of the closed argument to actually understand the implications on the size (i.e the example where the closed param is set to neither and can result in no window being calculated since the number of points is too few)

Example: window = 3 interval from 1 -> 4
SebastianOuslis marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down
6 changes: 3 additions & 3 deletions pandas/core/window/rolling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Example: window = 3 interval from 1 -> 4

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
Expand Down
Loading