-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Center rolling window for time offset #38780
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
Changes from all commits
11c1bb7
3cac891
c73ffc4
58a8ebf
dca9d04
37cb6fa
81e0e4e
463c7f0
321f07c
9270bab
dd33e32
6e4da84
e0966e8
b82f514
18a7b5b
9c4cc58
c27f50e
abaa43b
dc046da
95e3f26
8d582a1
8d5a55c
525cc69
6ac79b9
9bf6ce3
4f98fc5
e5ae3b2
d106940
d4f6d22
c2a7333
73313e6
92f8992
648d2d3
278d33f
5e50f36
c11cf15
2e3f875
f63309b
9f76a41
f05ed61
6fbd080
dff6942
0520e18
a087a6b
5b9b8ff
fca3b4d
6c1c58a
b7e5035
f44c6e6
3dcad64
0f9f6df
315b320
f7d1110
fc88ae4
e07a1f2
cefbb16
edbfd21
bfc0f0d
43e04ed
1e724dc
47a3b14
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,6 +134,23 @@ a copy will no longer be made (:issue:`32960`) | |
The default behavior when not passing ``copy`` will remain unchanged, i.e. | ||
a copy will be made. | ||
|
||
Centered Datetime-Like Rolling Windows | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would not object to an example in window.rst as well There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added the same example also to the window.rst now |
||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
When performing rolling calculations on :class:`DataFrame` and :class:`Series` | ||
objects with a datetime-like index, a centered datetime-like window can now be | ||
used (:issue:`38780`). | ||
For example: | ||
|
||
.. ipython:: python | ||
|
||
df = pd.DataFrame( | ||
{"A": [0, 1, 2, 3, 4]}, index=pd.date_range("2020", periods=5, freq="1D") | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment as above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
df | ||
df.rolling("2D", center=True).mean() | ||
|
||
|
||
.. _whatsnew_130.enhancements.other: | ||
|
||
Other enhancements | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a versionadded 1.3 tag here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, too!