Skip to content

Commit

Permalink
REF: multi_take is now able to tackle all list-like (non-bool) cases
Browse files Browse the repository at this point in the history
  • Loading branch information
toobaz committed Jun 21, 2018
1 parent f4fba9e commit f44aaad
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions pandas/core/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -902,23 +902,12 @@ def _getitem_tuple(self, tup):
return retval

def _multi_take_opportunity(self, tup):
from pandas.core.generic import NDFrame

# ugly hack for GH #836
if not isinstance(self.obj, NDFrame):
return False

if not all(is_list_like_indexer(x) for x in tup):
return False

# just too complicated
for indexer, ax in zip(tup, self.obj._data.axes):
if isinstance(ax, MultiIndex):
return False
elif com.is_bool_indexer(indexer):
return False
elif not ax.is_unique:
return False
if any(com.is_bool_indexer(x) for x in tup):
return False

return True

Expand Down

0 comments on commit f44aaad

Please sign in to comment.