-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: implement drop_levels argument in loc #35418
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
Comments
Thanks @arw2019 for writing this up.
I think that would make sense. we already have an
If However, if |
There may be api breaking implications with adding a currently
so I don't think that the default could be |
Haven't read too closely yet, but I don't think we should treat |
I agree with Tom |
Where does it say xs is slated for deprecation? |
listed under potential at #18262 with a couple of -1's in the discussion and #6249 (comment) |
Seems to be not much enthusiasm for this feature even if xs doesn't get deprecated, so closing due to lack of support. Can reopen if another use case supporting this feature is raised |
xref #6249, #18262, #35301
Following up on #35301. This is an outstanding piece of
DataFrame.xs
functionality that's currently not available in.loc
. Sincexs
is slated for deprecation I'd like implement this in.loc
Example
Let's define a multiindexed dataframe (example from
xs
docs)xs
and.loc
both let us take a cross-section through aMultiIndex
but with
xs
we can choose to keep the index columns through which we're slicing using thedrop_level
argument:new API
Looking for ideas on what's appropriate here. Based off of suggestions in #6249 would something like this work?
The text was updated successfully, but these errors were encountered: