|
2 | 2 | import datetime
|
3 | 3 | import warnings
|
4 | 4 | import operator
|
5 |
| - |
6 | 5 | from functools import partial
|
7 |
| -from pandas.compat import range, zip, lrange, lzip, u, reduce, filter, map |
8 |
| -from pandas import compat |
9 |
| -import numpy as np |
10 |
| - |
11 | 6 | from sys import getsizeof
|
| 7 | + |
| 8 | +import numpy as np |
12 | 9 | import pandas.tslib as tslib
|
13 | 10 | import pandas.lib as lib
|
14 | 11 | import pandas.algos as _algos
|
15 | 12 | import pandas.index as _index
|
16 | 13 | from pandas.lib import Timestamp, Timedelta, is_datetime_array
|
| 14 | + |
| 15 | +from pandas.compat import range, zip, lrange, lzip, u, map |
| 16 | +from pandas import compat |
17 | 17 | from pandas.core.base import PandasObject, FrozenList, FrozenNDArray, IndexOpsMixin, _shared_docs, PandasDelegate
|
18 | 18 | from pandas.util.decorators import (Appender, Substitution, cache_readonly,
|
19 | 19 | deprecate, deprecate_kwarg)
|
|
26 | 26 | from pandas.core.config import get_option
|
27 | 27 | from pandas.io.common import PerformanceWarning
|
28 | 28 |
|
| 29 | + |
| 30 | + |
| 31 | + |
29 | 32 | # simplify
|
30 | 33 | default_pprint = lambda x, max_seq_items=None: com.pprint_thing(x,
|
31 | 34 | escape_chars=('\t', '\r', '\n'),
|
@@ -973,7 +976,9 @@ def _convert_list_indexer(self, keyarr, kind=None):
|
973 | 976 | and we have a mixed index (e.g. number/labels). figure out
|
974 | 977 | the indexer. return None if we can't help
|
975 | 978 | """
|
976 |
| - if (kind is None or kind in ['iloc','ix']) and (is_integer_dtype(keyarr) and not self.is_floating()): |
| 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)): |
| 981 | + |
977 | 982 | if self.inferred_type != 'integer':
|
978 | 983 | keyarr = np.where(keyarr < 0,
|
979 | 984 | len(self) + keyarr, keyarr)
|
|
0 commit comments