@@ -545,14 +545,24 @@ def get_axe(block, qs, axes):
545545 def isna (self , func ) -> "BlockManager" :
546546 return self .apply ("apply" , func = func )
547547
548- def where (self , ** kwargs ) -> "BlockManager" :
549- if kwargs .pop ("align" , True ):
548+ def where (
549+ self , other , cond , align : bool , errors : str , try_cast : bool , axis : int
550+ ) -> "BlockManager" :
551+ if align :
550552 align_keys = ["other" , "cond" ]
551553 else :
552554 align_keys = ["cond" ]
553- kwargs [ " other" ] = extract_array (kwargs [ " other" ] , extract_numpy = True )
555+ other = extract_array (other , extract_numpy = True )
554556
555- return self .apply ("where" , align_keys = align_keys , ** kwargs )
557+ return self .apply (
558+ "where" ,
559+ align_keys = align_keys ,
560+ other = other ,
561+ cond = cond ,
562+ errors = errors ,
563+ try_cast = try_cast ,
564+ axis = axis ,
565+ )
556566
557567 def setitem (self , indexer , value ) -> "BlockManager" :
558568 return self .apply ("setitem" , indexer = indexer , value = value )
@@ -584,11 +594,13 @@ def diff(self, n: int, axis: int) -> "BlockManager":
584594 def interpolate (self , ** kwargs ) -> "BlockManager" :
585595 return self .apply ("interpolate" , ** kwargs )
586596
587- def shift (self , ** kwargs ) -> "BlockManager" :
588- return self .apply ("shift" , ** kwargs )
597+ def shift (self , periods : int , axis : int , fill_value ) -> "BlockManager" :
598+ return self .apply ("shift" , periods = periods , axis = axis , fill_value = fill_value )
589599
590- def fillna (self , ** kwargs ) -> "BlockManager" :
591- return self .apply ("fillna" , ** kwargs )
600+ def fillna (self , value , limit , inplace : bool , downcast ) -> "BlockManager" :
601+ return self .apply (
602+ "fillna" , value = value , limit = limit , inplace = inplace , downcast = downcast
603+ )
592604
593605 def downcast (self ) -> "BlockManager" :
594606 return self .apply ("downcast" )
@@ -753,9 +765,7 @@ def _combine(self, blocks: List[Block], copy: bool = True) -> "BlockManager":
753765 new_blocks = []
754766 for b in blocks :
755767 b = b .copy (deep = copy )
756- b .mgr_locs = algos .take_1d (
757- inv_indexer , b .mgr_locs .as_array , axis = 0 , allow_fill = False
758- )
768+ b .mgr_locs = inv_indexer [b .mgr_locs .indexer ]
759769 new_blocks .append (b )
760770
761771 axes = list (self .axes )
0 commit comments