|
19 | 19 | deprecate, deprecate_kwarg)
|
20 | 20 | import pandas.core.common as com
|
21 | 21 | from pandas.core.common import (isnull, array_equivalent, is_dtype_equal, is_object_dtype,
|
22 |
| - is_datetimetz, |
| 22 | + is_datetimetz, ABCSeries, ABCCategorical, ABCPeriodIndex, |
23 | 23 | _values_from_object, is_float, is_integer, is_iterator, is_categorical_dtype,
|
24 |
| - ABCSeries, ABCCategorical, _ensure_object, _ensure_int64, is_bool_indexer, |
| 24 | + _ensure_object, _ensure_int64, is_bool_indexer, |
25 | 25 | is_list_like, is_bool_dtype, is_null_slice, is_integer_dtype)
|
26 | 26 | from pandas.core.config import get_option
|
27 | 27 | from pandas.io.common import PerformanceWarning
|
@@ -976,8 +976,8 @@ def _convert_list_indexer(self, keyarr, kind=None):
|
976 | 976 | and we have a mixed index (e.g. number/labels). figure out
|
977 | 977 | the indexer. return None if we can't help
|
978 | 978 | """
|
979 |
| - if (kind is None or kind in ['iloc', 'ix']) and ( |
980 |
| - is_integer_dtype(keyarr) and not self.is_floating() and not com.is_period_arraylike(keyarr)): |
| 979 | + if kind in [None, 'iloc', 'ix'] and is_integer_dtype(keyarr) \ |
| 980 | + and not self.is_floating() and not isinstance(keyarr, ABCPeriodIndex): |
981 | 981 |
|
982 | 982 | if self.inferred_type != 'integer':
|
983 | 983 | keyarr = np.where(keyarr < 0,
|
|
0 commit comments