-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
resample.apply flattens column index when more than 3 levels #16231
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
this is probably also applicable to groupby, these use the same machinery. welcome for you to have a look. This is prob pretty deep in the code. |
I honestly have no idea where to start on this one. (For the record, a workaround is simply to do |
dsm054
added a commit
to dsm054/pandas
that referenced
this issue
Jun 9, 2017
dsm054
pushed a commit
to dsm054/pandas
that referenced
this issue
Jun 9, 2017
dsm054
added a commit
to dsm054/pandas
that referenced
this issue
Jun 9, 2017
4 tasks
dsm054
added a commit
to dsm054/pandas
that referenced
this issue
Jun 10, 2017
dsm054
added a commit
to dsm054/pandas
that referenced
this issue
Jun 10, 2017
This above error doesn't raise an error on master. Could use some sort of simplified regression test.
|
10 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Code Sample, a copy-pastable example if possible
Problem description
With MultiIndexed columns that have 2 or 3 levels, the resample().apply() does return the same MultiIndexed columns. If you go to 4 levels, returned is a single-level column where only the first level is kept.
In the above code, only the case nlevels=4 raises.
Expected Output
The above code shouldn't raise.
Output of
pd.show_versions()
pandas: 0.19.2
nose: None
pip: 9.0.1
setuptools: 34.3.0
Cython: 0.25.2
numpy: 1.12.0
scipy: 0.18.1
statsmodels: 0.8.0
xarray: 0.9.1
IPython: 5.3.0
sphinx: None
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2016.10
blosc: None
bottleneck: 1.2.0
tables: 3.3.0
numexpr: 2.6.2
matplotlib: 2.0.0
openpyxl: None
xlrd: 1.0.0
xlwt: 1.2.0
xlsxwriter: 0.9.6
lxml: None
bs4: 4.5.3
html5lib: 0.9999999
httplib2: 0.10.3
apiclient: 1.6.2
sqlalchemy: 1.1.5
pymysql: None
psycopg2: None
jinja2: 2.9.5
boto: None
pandas_datareader: 0.3.0.post
The text was updated successfully, but these errors were encountered: