7474 ensure_block_shape ,
7575 extend_blocks ,
7676 get_block_type ,
77- make_block ,
77+ new_block ,
7878)
7979from pandas .core .internals .ops import (
8080 blockwise_all ,
@@ -322,7 +322,7 @@ def unpickle_block(values, mgr_locs, ndim: int):
322322 # TODO(EA2D): ndim would be unnecessary with 2D EAs
323323 # older pickles may store e.g. DatetimeIndex instead of DatetimeArray
324324 values = extract_array (values , extract_numpy = True )
325- return make_block (values , placement = mgr_locs , ndim = ndim )
325+ return new_block (values , placement = mgr_locs , ndim = ndim )
326326
327327 if isinstance (state , tuple ) and len (state ) >= 4 and "0.14.1" in state [3 ]:
328328 state = state [3 ]["0.14.1" ]
@@ -1148,7 +1148,7 @@ def value_getitem(placement):
11481148 # one item.
11491149 # TODO(EA2D): special casing unnecessary with 2D EAs
11501150 new_blocks .extend (
1151- make_block (
1151+ new_block (
11521152 values = value ,
11531153 ndim = self .ndim ,
11541154 placement = slice (mgr_loc , mgr_loc + 1 ),
@@ -1164,7 +1164,7 @@ def value_getitem(placement):
11641164 unfit_val_items = unfit_val_locs [0 ].append (unfit_val_locs [1 :])
11651165
11661166 new_blocks .append (
1167- make_block (
1167+ new_block (
11681168 values = value_getitem (unfit_val_items ),
11691169 ndim = self .ndim ,
11701170 placement = unfit_mgr_locs ,
@@ -1209,7 +1209,7 @@ def insert(self, loc: int, item: Hashable, value, allow_duplicates: bool = False
12091209 value = ensure_block_shape (value , ndim = 2 )
12101210
12111211 # TODO: type value as ArrayLike
1212- block = make_block (values = value , ndim = self .ndim , placement = slice (loc , loc + 1 ))
1212+ block = new_block (values = value , ndim = self .ndim , placement = slice (loc , loc + 1 ))
12131213
12141214 for blkno , count in _fast_count_smallints (self .blknos [loc :]):
12151215 blk = self .blocks [blkno ]
@@ -1436,7 +1436,7 @@ def _make_na_block(self, placement, fill_value=None):
14361436 dtype , fill_value = infer_dtype_from_scalar (fill_value )
14371437 block_values = np .empty (block_shape , dtype = dtype )
14381438 block_values .fill (fill_value )
1439- return make_block (block_values , placement = placement , ndim = block_values .ndim )
1439+ return new_block (block_values , placement = placement , ndim = block_values .ndim )
14401440
14411441 def take (self , indexer , axis : int = 1 , verify : bool = True , convert : bool = True ):
14421442 """
@@ -1562,7 +1562,7 @@ def from_array(cls, array: ArrayLike, index: Index) -> SingleBlockManager:
15621562 """
15631563 Constructor for if we have an array that is not yet a Block.
15641564 """
1565- block = make_block (array , placement = slice (0 , len (index )), ndim = 1 )
1565+ block = new_block (array , placement = slice (0 , len (index )), ndim = 1 )
15661566 return cls (block , index )
15671567
15681568 def _post_setstate (self ):
@@ -1669,7 +1669,7 @@ def create_block_manager_from_blocks(blocks, axes: List[Index]) -> BlockManager:
16691669 # is basically "all items", but if there're many, don't bother
16701670 # converting, it's an error anyway.
16711671 blocks = [
1672- make_block (
1672+ new_block (
16731673 values = blocks [0 ], placement = slice (0 , len (axes [0 ])), ndim = 2
16741674 )
16751675 ]
@@ -1780,7 +1780,7 @@ def _form_blocks(
17801780
17811781 if len (items_dict ["DatetimeTZBlock" ]):
17821782 dttz_blocks = [
1783- make_block (array , klass = DatetimeTZBlock , placement = i , ndim = 2 )
1783+ new_block (array , klass = DatetimeTZBlock , placement = i , ndim = 2 )
17841784 for i , array in items_dict ["DatetimeTZBlock" ]
17851785 ]
17861786 blocks .extend (dttz_blocks )
@@ -1791,22 +1791,22 @@ def _form_blocks(
17911791
17921792 if len (items_dict ["CategoricalBlock" ]) > 0 :
17931793 cat_blocks = [
1794- make_block (array , klass = CategoricalBlock , placement = i , ndim = 2 )
1794+ new_block (array , klass = CategoricalBlock , placement = i , ndim = 2 )
17951795 for i , array in items_dict ["CategoricalBlock" ]
17961796 ]
17971797 blocks .extend (cat_blocks )
17981798
17991799 if len (items_dict ["ExtensionBlock" ]):
18001800 external_blocks = [
1801- make_block (array , klass = ExtensionBlock , placement = i , ndim = 2 )
1801+ new_block (array , klass = ExtensionBlock , placement = i , ndim = 2 )
18021802 for i , array in items_dict ["ExtensionBlock" ]
18031803 ]
18041804
18051805 blocks .extend (external_blocks )
18061806
18071807 if len (items_dict ["ObjectValuesExtensionBlock" ]):
18081808 external_blocks = [
1809- make_block (array , klass = ObjectValuesExtensionBlock , placement = i , ndim = 2 )
1809+ new_block (array , klass = ObjectValuesExtensionBlock , placement = i , ndim = 2 )
18101810 for i , array in items_dict ["ObjectValuesExtensionBlock" ]
18111811 ]
18121812
@@ -1819,7 +1819,7 @@ def _form_blocks(
18191819 block_values = np .empty (shape , dtype = object )
18201820 block_values .fill (np .nan )
18211821
1822- na_block = make_block (block_values , placement = extra_locs , ndim = 2 )
1822+ na_block = new_block (block_values , placement = extra_locs , ndim = 2 )
18231823 blocks .append (na_block )
18241824
18251825 return blocks
@@ -1836,7 +1836,7 @@ def _simple_blockify(tuples, dtype) -> List[Block]:
18361836 if dtype is not None and values .dtype != dtype : # pragma: no cover
18371837 values = values .astype (dtype )
18381838
1839- block = make_block (values , placement = placement , ndim = 2 )
1839+ block = new_block (values , placement = placement , ndim = 2 )
18401840 return [block ]
18411841
18421842
@@ -1850,7 +1850,7 @@ def _multi_blockify(tuples, dtype: Optional[Dtype] = None):
18501850
18511851 values , placement = _stack_arrays (list (tup_block ), dtype )
18521852
1853- block = make_block (values , placement = placement , ndim = 2 )
1853+ block = new_block (values , placement = placement , ndim = 2 )
18541854 new_blocks .append (block )
18551855
18561856 return new_blocks
@@ -1928,7 +1928,7 @@ def _merge_blocks(
19281928 new_values = new_values [argsort ]
19291929 new_mgr_locs = new_mgr_locs [argsort ]
19301930
1931- return [make_block (new_values , placement = new_mgr_locs , ndim = 2 )]
1931+ return [new_block (new_values , placement = new_mgr_locs , ndim = 2 )]
19321932
19331933 # can't consolidate --> no merge
19341934 return blocks
0 commit comments