Skip to content

BUG: fix error for reset_index() with index.name in MultiIndex columns #16126

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

Merged
merged 1 commit into from
Apr 25, 2017

Conversation

toobaz
Copy link
Member

@toobaz toobaz commented Apr 25, 2017

expected = df.copy()
df.index.name = 'A'
result = df[['B']].reset_index()
print(result)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no prints

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops.. sorry

@toobaz toobaz force-pushed the mi_reset_index_error branch from 9cc4fa3 to c6dec63 Compare April 25, 2017 09:51
@codecov
Copy link

codecov bot commented Apr 25, 2017

Codecov Report

Merging #16126 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16126      +/-   ##
==========================================
- Coverage   90.84%   90.83%   -0.01%     
==========================================
  Files         159      159              
  Lines       50774    50774              
==========================================
- Hits        46124    46123       -1     
- Misses       4650     4651       +1
Flag Coverage Δ
#multiple 88.62% <100%> (-0.01%) ⬇️
#single 40.33% <100%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/internals.py 93.44% <100%> (ø) ⬆️
pandas/core/indexes/datetimes.py 95.33% <0%> (-0.1%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ad32d2...c6dec63. Read the comment docs.

@codecov
Copy link

codecov bot commented Apr 25, 2017

Codecov Report

Merging #16126 into master will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #16126      +/-   ##
==========================================
- Coverage   90.84%   90.83%   -0.01%     
==========================================
  Files         159      159              
  Lines       50774    50774              
==========================================
- Hits        46124    46123       -1     
- Misses       4650     4651       +1
Flag Coverage Δ
#multiple 88.62% <100%> (-0.01%) ⬇️
#single 40.33% <100%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/internals.py 93.44% <100%> (ø) ⬆️
pandas/core/common.py 90.68% <0%> (-0.35%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ad32d2...c6dec63. Read the comment docs.

@jreback jreback added Bug Indexing Related to indexing on series/frames, not to indexes themselves labels Apr 25, 2017
@jreback jreback added this to the 0.20.0 milestone Apr 25, 2017
@jreback jreback merged commit 8ab8ad0 into pandas-dev:master Apr 25, 2017
@jreback
Copy link
Contributor

jreback commented Apr 25, 2017

thanks!

@toobaz toobaz deleted the mi_reset_index_error branch April 25, 2017 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong error from "reset_index()" when columns are MultiIndex and index name is incomplete column name
2 participants