@@ -545,14 +545,24 @@ def get_axe(block, qs, axes):
545
545
def isna (self , func ) -> "BlockManager" :
546
546
return self .apply ("apply" , func = func )
547
547
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 :
550
552
align_keys = ["other" , "cond" ]
551
553
else :
552
554
align_keys = ["cond" ]
553
- kwargs [ " other" ] = extract_array (kwargs [ " other" ] , extract_numpy = True )
555
+ other = extract_array (other , extract_numpy = True )
554
556
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
+ )
556
566
557
567
def setitem (self , indexer , value ) -> "BlockManager" :
558
568
return self .apply ("setitem" , indexer = indexer , value = value )
@@ -584,11 +594,13 @@ def diff(self, n: int, axis: int) -> "BlockManager":
584
594
def interpolate (self , ** kwargs ) -> "BlockManager" :
585
595
return self .apply ("interpolate" , ** kwargs )
586
596
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 )
589
599
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
+ )
592
604
593
605
def downcast (self ) -> "BlockManager" :
594
606
return self .apply ("downcast" )
@@ -753,9 +765,7 @@ def _combine(self, blocks: List[Block], copy: bool = True) -> "BlockManager":
753
765
new_blocks = []
754
766
for b in blocks :
755
767
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 ]
759
769
new_blocks .append (b )
760
770
761
771
axes = list (self .axes )
0 commit comments