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
This is actually not required, and so should work I think
(requires lexsorting only)
In [70]: df = DataFrame(dict(A = ['foo','foo','foo','foo'], B = ['a','a','a','a'], C = [1,2,1,3], D = [1,2,3,4])).set_index(['A','B','C']).sortlevel()
In [71]: df
Out[71]:
D
A B C
foo a 1 1
1 3
2 2
3 4
[4 rows x 1 columns]
In [72]: df.xs(1,level=2)
Out[72]:
D
A B
foo a 1
a 3
[2 rows x 1 columns]
In [73]: df.loc[(slice(None),slice(None),1),:]
ValueError: MultiIndex Slicing requires a unique index
The text was updated successfully, but these errors were encountered:
This is actually not required, and so should work I think
(requires lexsorting only)
The text was updated successfully, but these errors were encountered: