-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
EHN: Implement closed=left|right|neither in DataFrame.rolling for fixed windows #34315
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
Comments
The question here is, if If yes, we would break the following behavior:
The first rolling works, the second raises:
If this should not be the same, we should raise in the case above, because Thoughts @jbrockmendel @dsaxton ? |
cc @mroeschke ? |
@phofl your example is raising because you are using To the original issue, it's stated in the docs:
I suppose this should have raised a |
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Code Sample, a copy-pastable example
Problem description
The rolling window ignores the closed='left' parameter. Since it was supposed to be closed only on the left side, the current right side of the window should not be used on the calculations. But it turns out it is.
Original dataframe
Actual output
Expected Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.7.7.final.0
python-bits : 64
OS : Linux
OS-release : 4.15.0-70-generic
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : pt_BR.UTF-8
pandas : 1.0.3
numpy : 1.18.1
pytz : 2020.1
dateutil : 2.8.1
pip : 20.0.2
setuptools : 46.2.0.post20200511
Cython : None
pytest : 5.4.2
hypothesis : None
sphinx : 3.0.3
The text was updated successfully, but these errors were encountered: