You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
you can already do this with slicers (and has been this way for a while) dohttp://pandas.pydata.org/pandas-docs/stable/advanced.html#using-slicers
likeley to deprecate .xs anyhow.
In [3]: ix = pd.IndexSlice
In [4]: df.loc[ix[['bar', 'baz'], ['one', 'three']], :]
Out[4]:
0 1 2 3
bar one 3.019096 0.096874 -0.832045 1.413082
baz three 1.357525 0.124628 0.116054 1.759177
I like the drop level parameter of xs and that's the main reason I use it. I realised though that passing lists could make impossible to drop the filtered levels and that why I closed the issue.
It would probably be nice to allow for
df.xs([['bar', 'baz'], ['one', 'three']], level=[0,1])
The text was updated successfully, but these errors were encountered: