15
15
is_object_dtype ,
16
16
is_bool_dtype ,
17
17
is_dtype_equal ,
18
- is_range ,
19
18
_NS_DTYPE ,
20
19
_TD_DTYPE )
21
20
from pandas .core .dtypes .generic import (
22
21
ABCDatetimeIndex , ABCTimedeltaIndex ,
23
- ABCPeriodIndex )
22
+ ABCPeriodIndex , ABCRangeIndex )
24
23
25
24
26
25
def get_dtype_kinds (l ):
@@ -42,12 +41,12 @@ def get_dtype_kinds(l):
42
41
typ = 'category'
43
42
elif is_sparse (arr ):
44
43
typ = 'sparse'
44
+ elif isinstance (arr , ABCRangeIndex ):
45
+ typ = 'range'
45
46
elif is_datetimetz (arr ):
46
47
# if to_concat contains different tz,
47
48
# the result must be object dtype
48
49
typ = str (arr .dtype )
49
- elif is_range (arr ):
50
- typ = 'range'
51
50
elif is_datetime64_dtype (dtype ):
52
51
typ = 'datetime'
53
52
elif is_timedelta64_dtype (dtype ):
@@ -564,12 +563,14 @@ def convert_sparse(x, axis):
564
563
return result
565
564
566
565
567
- def _concat_indexes_same_dtype_rangeindex (indexes ):
568
- # Concatenates multiple RangeIndex instances. All members of "indexes" must
569
- # be of type RangeIndex; result will be RangeIndex if possible, Int64Index
570
- # otherwise. E.g.:
571
- # indexes = [RangeIndex(3), RangeIndex(3, 6)] -> RangeIndex(6)
572
- # indexes = [RangeIndex(3), RangeIndex(4, 6)] -> Int64Index([0,1,2,4,5])
566
+ def _concat_rangeindex_same_dtype (indexes ):
567
+ """
568
+ Concatenates multiple RangeIndex instances. All members of "indexes" must
569
+ be of type RangeIndex; result will be RangeIndex if possible, Int64Index
570
+ otherwise. E.g.:
571
+ indexes = [RangeIndex(3), RangeIndex(3, 6)] -> RangeIndex(6)
572
+ indexes = [RangeIndex(3), RangeIndex(4, 6)] -> Int64Index([0,1,2,4,5])
573
+ """
573
574
574
575
start = step = next = None
575
576
0 commit comments