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
The output above is inconsistent with versions of pandas prior to 1.1 and is inconsistent in the semantics of min_periods; the first element of each group has the same number of periods as the last, but its value is computed correctly. The last element of each group is also computed incorrectly (should be 2). Finally, the last element of the final group (4) should not be NA, but should again be 2.
Some similar issues have been reported since the changes to .groupby().rolling() made in pandas 1.1.0.
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
Outputs:
Problem description
For the given input
s
, where every element is 1, the snippet above should return the same as counting the number of values in each window:The output above is inconsistent with versions of pandas prior to 1.1 and is inconsistent in the semantics of
min_periods
; the first element of each group has the same number of periods as the last, but its value is computed correctly. The last element of each group is also computed incorrectly (should be 2). Finally, the last element of the final group (4) should not be NA, but should again be 2.Some similar issues have been reported since the changes to
.groupby().rolling()
made in pandas 1.1.0.Expected Output
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : 67a3d42
python : 3.8.5.final.0
python-bits : 64
OS : Windows
OS-release : 10
Version : 10.0.18362
machine : AMD64
processor : Intel64 Family 6 Model 142 Stepping 12, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : English_United States.1252
pandas : 1.1.4
numpy : 1.19.1
pytz : 2020.1
dateutil : 2.8.1
pip : 20.2.2
setuptools : 49.6.0.post20200814
Cython : None
pytest : 6.0.1
hypothesis : None
sphinx : 2.2.0
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : None
pandas_datareader: None
bs4 : 4.9.1
bottleneck : None
fsspec : None
fastparquet : None
gcsfs : None
matplotlib : 3.3.1
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pytables : None
pyxlsb : None
s3fs : None
scipy : 1.5.0
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
numba : None
The text was updated successfully, but these errors were encountered: