BUG: loc with a multi-index and a list incorrectly selecting by position · Issue #7349 · pandas-dev/pandas (original) (raw)
This is a bug; the first should work like the 2nd (it is incorrectly selecting by position); essentially this is .ix
fallback type behavior
In [10]: df = DataFrame(np.arange(12).reshape(-1,1),index=pd.MultiIndex.from_product([[1,2,3,4],[1,2,3]]))
In [11]: df.loc[[1,2]]
Out[11]:
0
1 2 1
3 2
In [12]: df.loc[([1,2],),:]
Out[12]:
0
1 1 0
2 1
3 2
2 1 3
2 4
3 5