Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
BUG: Joining single-index DataFrame to multiindex DF incorrect for how=left and how=right #10741
Comments
jreback
added Bug Reshaping
labels
Aug 3, 2015
jreback
added this to the
0.17.0
milestone
Aug 3, 2015
warmlogic
commented
Aug 3, 2015
|
Thanks, those do look the same/related. I searched before posting but didn't find them. Cheers! |
|
@warmlogic np, lots of issues outstanding! |
|
@warmlogic Thanks for the report. As @jreback said, #10716 can solve the issue. I've added your test case to the PR. |
sinhrks
referenced
this issue
Aug 4, 2015
Merged
BUG: Series.align with MultiIndex may be inverted #10716
jreback
closed this
in #10716
Aug 18, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
warmlogic commentedAug 3, 2015
When joining DataFrames where the calling frame is a multiindex DF and the input frame is a single-index DF,
how='left'andhow='right'produce results that should be swapped (i.e.,'left'returns what'right'should return, and vice versa). To give a single example usinghow='left':Expected (for
how='left'):Actual (for
how='left'):However, the correct behavior occurs if the single-index DF is the calling frame and the multiindex DF is the input frame (
df2.join(df1, how='left')). Behavior forhow='inner'andhow='outer'is correct in both situations.pandas version 0.16.2