177177from pandas .core .internals .construction import (
178178 arrays_to_mgr ,
179179 dataclasses_to_dicts ,
180- init_dict ,
181- init_ndarray ,
180+ dict_to_mgr ,
182181 masked_rec_array_to_mgr ,
183182 mgr_to_mgr ,
183+ ndarray_to_mgr ,
184184 nested_data_to_arrays ,
185185 reorder_arrays ,
186186 sanitize_index ,
@@ -575,7 +575,7 @@ def __init__(
575575 )
576576
577577 elif isinstance (data , dict ):
578- mgr = init_dict (data , index , columns , dtype = dtype )
578+ mgr = dict_to_mgr (data , index , columns , dtype = dtype )
579579 elif isinstance (data , ma .MaskedArray ):
580580 import numpy .ma .mrecords as mrecords
581581
@@ -586,19 +586,19 @@ def __init__(
586586 # a masked array
587587 else :
588588 data = sanitize_masked_array (data )
589- mgr = init_ndarray (data , index , columns , dtype = dtype , copy = copy )
589+ mgr = ndarray_to_mgr (data , index , columns , dtype = dtype , copy = copy )
590590
591591 elif isinstance (data , (np .ndarray , Series , Index )):
592592 if data .dtype .names :
593593 data_columns = list (data .dtype .names )
594594 data = {k : data [k ] for k in data_columns }
595595 if columns is None :
596596 columns = data_columns
597- mgr = init_dict (data , index , columns , dtype = dtype )
597+ mgr = dict_to_mgr (data , index , columns , dtype = dtype )
598598 elif getattr (data , "name" , None ) is not None :
599- mgr = init_dict ({data .name : data }, index , columns , dtype = dtype )
599+ mgr = dict_to_mgr ({data .name : data }, index , columns , dtype = dtype )
600600 else :
601- mgr = init_ndarray (data , index , columns , dtype = dtype , copy = copy )
601+ mgr = ndarray_to_mgr (data , index , columns , dtype = dtype , copy = copy )
602602
603603 # For data is list-like, or Iterable (will consume into list)
604604 elif is_list_like (data ):
@@ -613,9 +613,9 @@ def __init__(
613613 )
614614 mgr = arrays_to_mgr (arrays , columns , index , columns , dtype = dtype )
615615 else :
616- mgr = init_ndarray (data , index , columns , dtype = dtype , copy = copy )
616+ mgr = ndarray_to_mgr (data , index , columns , dtype = dtype , copy = copy )
617617 else :
618- mgr = init_dict ({}, index , columns , dtype = dtype )
618+ mgr = dict_to_mgr ({}, index , columns , dtype = dtype )
619619 # For data is scalar
620620 else :
621621 if index is None or columns is None :
@@ -638,7 +638,7 @@ def __init__(
638638 data , len (index ), len (columns ), dtype , copy
639639 )
640640
641- mgr = init_ndarray (
641+ mgr = ndarray_to_mgr (
642642 values , index , columns , dtype = values .dtype , copy = False
643643 )
644644
0 commit comments