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
I believe there may be a bug: If I have a DatetimeIndex in the columns, specifying an offset for df.rolling does not work but gives a value error (that the window must be an integer). It works however as expected if I transpose the dataframe.
Output of pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.7.4.final.0
python-bits : 64
OS : Windows
OS-release : 10
machine : AMD64
processor : Intel64 Family 6 Model 158 Stepping 10, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : None.None
Our support for rolling across axis=1 is less tested and feature complete than axis=0 so not terribly surprising. If you'd like to investigate and submit a PR would certainly be welcome
In your example with axis=0, then in Rolling.validate from pandas/core/windows/rolling.py, self.is_datetimelike returns True, while for axis=1 it returns False. If you're not working on this, I'd be interested in giving it a go
Code Sample
Here I have a DataFrame with a DatetimeIndex for the columns:
The above gives 'ValueError: window must be an integer'
Here I have a DataFrame with a DatetimeIndex for the rows:
However this works totally fine.
Problem description
I believe there may be a bug: If I have a DatetimeIndex in the columns, specifying an offset for df.rolling does not work but gives a value error (that the window must be an integer). It works however as expected if I transpose the dataframe.
Output of
pd.show_versions()
INSTALLED VERSIONS
commit : None
python : 3.7.4.final.0
python-bits : 64
OS : Windows
OS-release : 10
machine : AMD64
processor : Intel64 Family 6 Model 158 Stepping 10, GenuineIntel
byteorder : little
LC_ALL : None
LANG : None
LOCALE : None.None
pandas : 0.25.1
numpy : 1.16.4
pytz : 2019.2
dateutil : 2.8.0
pip : 19.2.2
setuptools : 41.0.1
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.10.1
IPython : 7.7.0
pandas_datareader: None
bs4 : None
bottleneck : None
fastparquet : None
gcsfs : None
lxml.etree : None
matplotlib : 3.1.0
numexpr : None
odfpy : None
openpyxl : 2.6.2
pandas_gbq : None
pyarrow : None
pytables : None
s3fs : None
scipy : 1.3.1
sqlalchemy : None
tables : None
xarray : None
xlrd : 1.2.0
xlwt : None
xlsxwriter : None
The text was updated successfully, but these errors were encountered: