-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
rolling( window='10D') does not work for df with MultiIndex #15584
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
Labels
Milestone
Comments
can you show your frame construction itself. |
I suspect you are doing something like this
So I thought we had an issue about this, but guess not. We need to:
|
time_index = pd.date_range( start, end, freq='1D', )
mi = pd.MultiIndex( levels=[time_index, [0]],
labels=[np.arange( len( time_index ) ), np.zeros( len( time_index ) )],
names=['time', 'int_index'] ) |
6 tasks
3 tasks
I am still getting this issue in version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem description
The offset feature of specifying timelike windows in 'rolling' doesn't work if the dataframe has multindex with level_0 = 'time' and level_1 = something else.
Expected Output
Works correctly.
Output of
pd.show_versions()
pandas: 0.19.2.post+ts3
nose: None
pip: 9.0.1
setuptools: 27.2.0
Cython: 0.25.2
numpy: 1.11.3
scipy: 0.18.1
statsmodels: 0.6.1
xarray: None
IPython: 5.1.0
sphinx: 1.5.1
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2016.10
blosc: None
bottleneck: 1.2.0
tables: 3.3.0
numexpr: 2.6.1
matplotlib: 1.5.3
openpyxl: 2.4.0
xlrd: 1.0.0
xlwt: None
xlsxwriter: 0.9.6
lxml: None
bs4: 4.5.3
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.1.4
pymysql: None
psycopg2: None
jinja2: 2.9.4
boto: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: