177
177
from pandas .core .internals .construction import (
178
178
arrays_to_mgr ,
179
179
dataclasses_to_dicts ,
180
- init_dict ,
181
- init_ndarray ,
180
+ dict_to_mgr ,
182
181
masked_rec_array_to_mgr ,
183
182
mgr_to_mgr ,
183
+ ndarray_to_mgr ,
184
184
nested_data_to_arrays ,
185
185
reorder_arrays ,
186
186
sanitize_index ,
@@ -575,7 +575,7 @@ def __init__(
575
575
)
576
576
577
577
elif isinstance (data , dict ):
578
- mgr = init_dict (data , index , columns , dtype = dtype )
578
+ mgr = dict_to_mgr (data , index , columns , dtype = dtype )
579
579
elif isinstance (data , ma .MaskedArray ):
580
580
import numpy .ma .mrecords as mrecords
581
581
@@ -586,19 +586,19 @@ def __init__(
586
586
# a masked array
587
587
else :
588
588
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 )
590
590
591
591
elif isinstance (data , (np .ndarray , Series , Index )):
592
592
if data .dtype .names :
593
593
data_columns = list (data .dtype .names )
594
594
data = {k : data [k ] for k in data_columns }
595
595
if columns is None :
596
596
columns = data_columns
597
- mgr = init_dict (data , index , columns , dtype = dtype )
597
+ mgr = dict_to_mgr (data , index , columns , dtype = dtype )
598
598
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 )
600
600
else :
601
- mgr = init_ndarray (data , index , columns , dtype = dtype , copy = copy )
601
+ mgr = ndarray_to_mgr (data , index , columns , dtype = dtype , copy = copy )
602
602
603
603
# For data is list-like, or Iterable (will consume into list)
604
604
elif is_list_like (data ):
@@ -613,9 +613,9 @@ def __init__(
613
613
)
614
614
mgr = arrays_to_mgr (arrays , columns , index , columns , dtype = dtype )
615
615
else :
616
- mgr = init_ndarray (data , index , columns , dtype = dtype , copy = copy )
616
+ mgr = ndarray_to_mgr (data , index , columns , dtype = dtype , copy = copy )
617
617
else :
618
- mgr = init_dict ({}, index , columns , dtype = dtype )
618
+ mgr = dict_to_mgr ({}, index , columns , dtype = dtype )
619
619
# For data is scalar
620
620
else :
621
621
if index is None or columns is None :
@@ -638,7 +638,7 @@ def __init__(
638
638
data , len (index ), len (columns ), dtype , copy
639
639
)
640
640
641
- mgr = init_ndarray (
641
+ mgr = ndarray_to_mgr (
642
642
values , index , columns , dtype = values .dtype , copy = False
643
643
)
644
644
0 commit comments