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
In [21]: df = pd.DataFrame({'a': [1], 'b': [2], 'c': [3]}).set_index(['a', 'b'])
In [22]: df.loc[1]
Out[22]:
c
b
2 3
In [23]: df.loc[(1,), slice(None)]
Out[23]:
c
b
2 3
In [24]: df.loc[(1, slice(None)), slice(None)]
Out[24]:
c
a b
1 2 3
In the last output, there should no longer be a level a.
The text was updated successfully, but these errors were encountered:
currently this is ONLY implemented for .xs and .loc with the axes (not multi-levels), though may work for a single multi-level as per the impl. I think @jorisvandenbossche is prob right, should squeeze scalars; this can be done as a post-processing step in .get_loc, so straightforward I think.
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: