A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pandas-dev/pandas/issues/7349 below:

loc with a multi-index and a list incorrectly selecting by position · Issue #7349 · pandas-dev/pandas · GitHub

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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4