@@ -460,13 +460,19 @@ def dict_to_mgr(
460
460
keys = list (data .keys ())
461
461
columns = Index (keys ) if keys else default_index (0 )
462
462
arrays = [com .maybe_iterable_to_list (data [k ]) for k in keys ]
463
- arrays = [arr if not isinstance (arr , Index ) else arr ._data for arr in arrays ]
464
463
465
464
if copy :
466
465
if typ == "block" :
467
466
# We only need to copy arrays that will not get consolidated, i.e.
468
467
# only EA arrays
469
- arrays = [x .copy () if isinstance (x , ExtensionArray ) else x for x in arrays ]
468
+ arrays = [
469
+ x .copy ()
470
+ if isinstance (x , ExtensionArray )
471
+ else x .copy (deep = True )
472
+ if isinstance (x , Index )
473
+ else x
474
+ for x in arrays
475
+ ]
470
476
else :
471
477
# dtype check to exclude e.g. range objects, scalars
472
478
arrays = [x .copy () if hasattr (x , "dtype" ) else x for x in arrays ]
@@ -573,10 +579,10 @@ def _homogenize(
573
579
refs : list [Any ] = []
574
580
575
581
for val in data :
576
- if isinstance (val , ABCSeries ):
582
+ if isinstance (val , ( ABCSeries , Index ) ):
577
583
if dtype is not None :
578
584
val = val .astype (dtype , copy = False )
579
- if val .index is not index :
585
+ if isinstance ( val , ABCSeries ) and val .index is not index :
580
586
# Forces alignment. No need to copy data since we
581
587
# are putting it into an ndarray later
582
588
val = val .reindex (index , copy = False )
0 commit comments