Skip to content

BUG: Fix MultiIndex names handling in pd.concat #15955

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

Closed
wants to merge 3 commits into from

Conversation

funnycrab
Copy link
Contributor

@funnycrab funnycrab commented Apr 9, 2017

This is a fix attempt for issue #15787.

The discrepancy between definition and corresponding implementation of so-called non-none names in function _get_consensus_names leads to this bug.

This is a fix attempt for issue pandas-dev#15787.

The discrepancy between definition and corresponding implementation of so-called non-none names in function _get_consensus_names leads to this bug.
df = pd.DataFrame({'col': range(5)}, index=index)

result = concat([df, df], keys=[1, 2], names=['level2'])
result = result.index.names
Copy link
Contributor

Choose a reason for hiding this comment

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

I would rather you actually construct the expected DF here (and use assert_frame_equal

@codecov
Copy link

codecov bot commented Apr 9, 2017

Codecov Report

Merging #15955 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15955      +/-   ##
==========================================
- Coverage      91%      91%   -0.01%     
==========================================
  Files         145      145              
  Lines       49576    49581       +5     
==========================================
+ Hits        45118    45121       +3     
- Misses       4458     4460       +2
Flag Coverage Δ
#multiple 88.77% <ø> (-0.01%) ⬇️
#single 40.57% <ø> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/indexes/api.py 98.66% <ø> (ø) ⬆️
pandas/util/testing.py 80.94% <0%> (-0.19%) ⬇️
pandas/core/base.py 95.51% <0%> (ø) ⬆️
pandas/core/series.py 94.89% <0%> (ø) ⬆️
pandas/core/categorical.py 95.85% <0%> (ø) ⬆️
pandas/core/algorithms.py 94.57% <0%> (+0.04%) ⬆️

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 f35209e...8c0e721. Read the comment docs.

@jreback jreback added this to the 0.20.0 milestone Apr 10, 2017
@jreback
Copy link
Contributor

jreback commented Apr 10, 2017

thanks!

@jreback jreback closed this in 9cb2c2d Apr 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: concat of MultiIndex with names passed
3 participants