You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rolling results like rolling.max/min are unreliable when rolling with variable window length. This issue occurs when start points of sub-windows are not monotonic increasing.
In this case, due to the algo described in aggregations.pyx, the deque will drop data points between point 2 and 3, which should be counted in 2st window.
You can reproduce this issue in codes above and find the print is False in most case.
I understand the O(n) complexity and efficiency of the algo in aggregations.pyx. However this may cause potential calculation error. I think we should add an montonic check in the module to decide which algo should be utilized.
Expected Behavior
the expected result should be ret6 in codes above.
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
Rolling results like rolling.max/min are unreliable when rolling with variable window length. This issue occurs when start points of sub-windows are not monotonic increasing.
For example:
1st window's start / end: (4, 10)
2st windows' start / end: (2, 11)
In this case, due to the algo described in aggregations.pyx, the deque will drop data points between point 2 and 3, which should be counted in 2st window.
You can reproduce this issue in codes above and find the print is False in most case.
I understand the O(n) complexity and efficiency of the algo in aggregations.pyx. However this may cause potential calculation error. I think we should add an montonic check in the module to decide which algo should be utilized.
Expected Behavior
the expected result should be ret6 in codes above.
Installed Versions
INSTALLED VERSIONS
commit : 66e3805
python : 3.7.8.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.18362
machine : AMD64
processor : Intel64 Family 6 Model 165 Stepping 5, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : None.None
pandas : 1.3.5
numpy : 1.19.5
pytz : 2021.1
dateutil : 2.8.1
pip : 21.0.1
setuptools : 54.0.0
Cython : 0.29.22
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : 4.6.2
html5lib : None
pymysql : 1.0.2
psycopg2 : 2.8.6 (dt dec pq3 ext lo64)
jinja2 : 3.0.3
IPython : 7.21.0
pandas_datareader: None
bs4 : 4.9.3
bottleneck : 1.3.2
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.4.1
numexpr : 2.7.3
odfpy : None
openpyxl : 3.0.6
pandas_gbq : None
pyarrow : 2.0.0
pyxlsb : None
s3fs : None
scipy : 1.6.1
sqlalchemy : 1.3.23
tables : 3.6.1
tabulate : 0.8.9
xarray : None
xlrd : 2.0.1
xlwt : None
numba : 0.54.0
The text was updated successfully, but these errors were encountered: