@@ -277,11 +277,11 @@ def __new__(
277
277
cls , data = None , dtype = None , copy = False , name = None , tupleize_cols = True , ** kwargs ,
278
278
) -> "Index" :
279
279
280
- from .range import RangeIndex
280
+ from pandas . core . indexes .range import RangeIndex
281
281
from pandas import PeriodIndex , DatetimeIndex , TimedeltaIndex
282
- from .numeric import Float64Index , Int64Index , UInt64Index
283
- from .interval import IntervalIndex
284
- from .category import CategoricalIndex
282
+ from pandas . core . indexes .numeric import Float64Index , Int64Index , UInt64Index
283
+ from pandas . core . indexes .interval import IntervalIndex
284
+ from pandas . core . indexes .category import CategoricalIndex
285
285
286
286
name = maybe_extract_name (name , data , cls )
287
287
@@ -408,7 +408,7 @@ def __new__(
408
408
if data and all (isinstance (e , tuple ) for e in data ):
409
409
# we must be all tuples, otherwise don't construct
410
410
# 10697
411
- from .multi import MultiIndex
411
+ from pandas . core . indexes .multi import MultiIndex
412
412
413
413
return MultiIndex .from_tuples (
414
414
data , names = name or kwargs .get ("names" )
@@ -679,7 +679,7 @@ def astype(self, dtype, copy=True):
679
679
return self .copy () if copy else self
680
680
681
681
elif is_categorical_dtype (dtype ):
682
- from .category import CategoricalIndex
682
+ from pandas . core . indexes .category import CategoricalIndex
683
683
684
684
return CategoricalIndex (self .values , name = self .name , dtype = dtype , copy = copy )
685
685
@@ -1514,7 +1514,7 @@ def droplevel(self, level=0):
1514
1514
result ._name = new_names [0 ]
1515
1515
return result
1516
1516
else :
1517
- from .multi import MultiIndex
1517
+ from pandas . core . indexes .multi import MultiIndex
1518
1518
1519
1519
return MultiIndex (
1520
1520
levels = new_levels ,
@@ -3328,7 +3328,7 @@ def join(self, other, how="left", level=None, return_indexers=False, sort=False)
3328
3328
return join_index
3329
3329
3330
3330
def _join_multi (self , other , how , return_indexers = True ):
3331
- from .multi import MultiIndex
3331
+ from pandas . core . indexes .multi import MultiIndex
3332
3332
from pandas .core .reshape .merge import _restore_dropped_levels_multijoin
3333
3333
3334
3334
# figure out join names
@@ -3435,7 +3435,7 @@ def _join_level(
3435
3435
MultiIndex will not be changed; otherwise, it will tie out
3436
3436
with `other`.
3437
3437
"""
3438
- from .multi import MultiIndex
3438
+ from pandas . core . indexes .multi import MultiIndex
3439
3439
3440
3440
def _get_leaf_sorter (labels ):
3441
3441
"""
@@ -4519,7 +4519,7 @@ def map(self, mapper, na_action=None):
4519
4519
a MultiIndex will be returned.
4520
4520
"""
4521
4521
4522
- from .multi import MultiIndex
4522
+ from pandas . core . indexes .multi import MultiIndex
4523
4523
4524
4524
new_values = super ()._map_values (mapper , na_action = na_action )
4525
4525
@@ -5240,7 +5240,7 @@ def ensure_index_from_sequences(sequences, names=None):
5240
5240
--------
5241
5241
ensure_index
5242
5242
"""
5243
- from .multi import MultiIndex
5243
+ from pandas . core . indexes .multi import MultiIndex
5244
5244
5245
5245
if len (sequences ) == 1 :
5246
5246
if names is not None :
@@ -5301,7 +5301,7 @@ def ensure_index(index_like, copy=False):
5301
5301
converted , all_arrays = lib .clean_index_list (index_like )
5302
5302
5303
5303
if len (converted ) > 0 and all_arrays :
5304
- from .multi import MultiIndex
5304
+ from pandas . core . indexes .multi import MultiIndex
5305
5305
5306
5306
return MultiIndex .from_arrays (converted )
5307
5307
else :
0 commit comments