1515 is_object_dtype ,
1616 is_bool_dtype ,
1717 is_dtype_equal ,
18- is_range ,
1918 _NS_DTYPE ,
2019 _TD_DTYPE )
2120from pandas .core .dtypes .generic import (
2221 ABCDatetimeIndex , ABCTimedeltaIndex ,
23- ABCPeriodIndex )
22+ ABCPeriodIndex , ABCRangeIndex )
2423
2524
2625def get_dtype_kinds (l ):
@@ -42,12 +41,12 @@ def get_dtype_kinds(l):
4241 typ = 'category'
4342 elif is_sparse (arr ):
4443 typ = 'sparse'
44+ elif isinstance (arr , ABCRangeIndex ):
45+ typ = 'range'
4546 elif is_datetimetz (arr ):
4647 # if to_concat contains different tz,
4748 # the result must be object dtype
4849 typ = str (arr .dtype )
49- elif is_range (arr ):
50- typ = 'range'
5150 elif is_datetime64_dtype (dtype ):
5251 typ = 'datetime'
5352 elif is_timedelta64_dtype (dtype ):
@@ -564,12 +563,14 @@ def convert_sparse(x, axis):
564563 return result
565564
566565
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+ """
573574
574575 start = step = next = None
575576
0 commit comments