-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
ERR: warning on merging on unequal levels for an Index #13094
Comments
Join only merges on matching index levels, you only have a single level that matches. This is as expected and well defined. I suppose its possible
I think this should actually trigger the warning that was added in 0.18.1, see here |
cc @nbonnotte |
Actually the warning IS buggy. want to do a PR to fix? (the behavior IS correct, but user's should be warned that they are not merging on all levels) |
take |
@jreback I know this issue is a few years old but could I get some clarification on when the warning is supposed to trigger or what the bug in said warning refers to? When you say levels are unequal, what do you mean, because to my understanding, the cases above should not trigger the warning at all? |
We have assumed that the issue relates to index.nlevels and have added a check for comparisons between left and right index nlevels that trigger the warning. |
I found what seems to me a behavior that might be wrong when joining a simple index df with a multiindex df.
I'm admittedly not an SQL expert and I'm not sure this is really a bug.
Consider the case:
I see the rational for not returning the line indexed by
a=2
inX
: since there is no value for the levelb
to associate to this line it is discarded.But I'm wondering if this output would not be also reasonable:
In SQL the result of (where I replace
X
byX.reset_index()
and similarly forY
):would contain the line
Any thought?
For completeness, the same issue is present for
how='outer'
.The text was updated successfully, but these errors were encountered: