-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
BUG: DataFrame.loc with a MultiIndex does not always collapse scalar levels #10552
Comments
The prior impl made this hard to do, but was just refactored so I think it could be fixed up to give the proper semantics (e.g. scalar vs. list-like). |
Just to be clear, the general rule we want is: "if the level indexer is a scalar, collapse the level, otherwise keep the level". Correct? This should then also hold for levels that are not up front? So this
would give So
|
currently this is ONLY implemented for |
All of the following should be equivalent:
In the last output, there should no longer be a level
a
.The text was updated successfully, but these errors were encountered: