Skip to content

Commit

Permalink
update arrayo
Browse files Browse the repository at this point in the history
  • Loading branch information
TomAugspurger committed Jan 2, 2020
1 parent 816a47c commit 21fd589
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pandas/tests/extension/decimal/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import pandas as pd
from pandas.api.extensions import register_extension_dtype
from pandas.core.arrays import ExtensionArray, ExtensionScalarOpsMixin
from pandas.core.common import is_bool_indexer
from pandas.core.indexers import check_bool_array_indexer


Expand Down Expand Up @@ -111,8 +110,13 @@ def __getitem__(self, item):
if isinstance(item, numbers.Integral):
return self._data[item]
else:
if is_bool_indexer(item):
item = check_bool_array_indexer(self, item)
# array, slice.
if pd.api.types.is_list_like(item):
if not pd.api.types.is_array_like(item):
item = pd.array(item)
dtype = item.dtype
if pd.api.types.is_bool_dtype(dtype):
item = check_bool_array_indexer(self, item)
return type(self)(self._data[item])

def take(self, indexer, allow_fill=False, fill_value=None):
Expand Down

0 comments on commit 21fd589

Please sign in to comment.