@@ -724,7 +724,7 @@ def replace(
724
724
# _can_hold_element checks have reduced this back to the
725
725
# scalar case and we can avoid a costly object cast
726
726
return self .replace (
727
- to_replace [0 ], value , inplace = inplace , regex = regex , convert = convert ,
727
+ to_replace [0 ], value , inplace = inplace , regex = regex , convert = convert
728
728
)
729
729
730
730
# GH 22083, TypeError or ValueError occurred within error handling
@@ -905,7 +905,7 @@ def setitem(self, indexer, value):
905
905
return block
906
906
907
907
def putmask (
908
- self , mask , new , inplace : bool = False , axis : int = 0 , transpose : bool = False ,
908
+ self , mask , new , inplace : bool = False , axis : int = 0 , transpose : bool = False
909
909
) -> List ["Block" ]:
910
910
"""
911
911
putmask the data to the block; it is possible that we may create a
@@ -1292,7 +1292,7 @@ def shift(self, periods: int, axis: int = 0, fill_value=None):
1292
1292
return [self .make_block (new_values )]
1293
1293
1294
1294
def where (
1295
- self , other , cond , errors = "raise" , try_cast : bool = False , axis : int = 0 ,
1295
+ self , other , cond , errors = "raise" , try_cast : bool = False , axis : int = 0
1296
1296
) -> List ["Block" ]:
1297
1297
"""
1298
1298
evaluate the block; return result block(s) from the result
@@ -1366,7 +1366,7 @@ def where_func(cond, values, other):
1366
1366
# we are explicitly ignoring errors
1367
1367
block = self .coerce_to_target_dtype (other )
1368
1368
blocks = block .where (
1369
- orig_other , cond , errors = errors , try_cast = try_cast , axis = axis ,
1369
+ orig_other , cond , errors = errors , try_cast = try_cast , axis = axis
1370
1370
)
1371
1371
return self ._maybe_downcast (blocks , "infer" )
1372
1372
@@ -1605,7 +1605,7 @@ def set(self, locs, values):
1605
1605
self .values = values
1606
1606
1607
1607
def putmask (
1608
- self , mask , new , inplace : bool = False , axis : int = 0 , transpose : bool = False ,
1608
+ self , mask , new , inplace : bool = False , axis : int = 0 , transpose : bool = False
1609
1609
) -> List ["Block" ]:
1610
1610
"""
1611
1611
See Block.putmask.__doc__
@@ -1816,7 +1816,7 @@ def diff(self, n: int, axis: int = 1) -> List["Block"]:
1816
1816
return super ().diff (n , axis )
1817
1817
1818
1818
def shift (
1819
- self , periods : int , axis : int = 0 , fill_value : Any = None ,
1819
+ self , periods : int , axis : int = 0 , fill_value : Any = None
1820
1820
) -> List ["ExtensionBlock" ]:
1821
1821
"""
1822
1822
Shift the block by `periods`.
@@ -1833,7 +1833,7 @@ def shift(
1833
1833
]
1834
1834
1835
1835
def where (
1836
- self , other , cond , errors = "raise" , try_cast : bool = False , axis : int = 0 ,
1836
+ self , other , cond , errors = "raise" , try_cast : bool = False , axis : int = 0
1837
1837
) -> List ["Block" ]:
1838
1838
1839
1839
cond = _extract_bool_array (cond )
@@ -1945,7 +1945,7 @@ def _can_hold_element(self, element: Any) -> bool:
1945
1945
)
1946
1946
1947
1947
def to_native_types (
1948
- self , na_rep = "" , float_format = None , decimal = "." , quoting = None , ** kwargs ,
1948
+ self , na_rep = "" , float_format = None , decimal = "." , quoting = None , ** kwargs
1949
1949
):
1950
1950
""" convert to our native types format """
1951
1951
values = self .values
@@ -2369,7 +2369,7 @@ def replace(self, to_replace, value, inplace=False, regex=False, convert=True):
2369
2369
if not np .can_cast (to_replace_values , bool ):
2370
2370
return self
2371
2371
return super ().replace (
2372
- to_replace , value , inplace = inplace , regex = regex , convert = convert ,
2372
+ to_replace , value , inplace = inplace , regex = regex , convert = convert
2373
2373
)
2374
2374
2375
2375
@@ -2453,18 +2453,18 @@ def replace(self, to_replace, value, inplace=False, regex=False, convert=True):
2453
2453
2454
2454
if not either_list and is_re (to_replace ):
2455
2455
return self ._replace_single (
2456
- to_replace , value , inplace = inplace , regex = True , convert = convert ,
2456
+ to_replace , value , inplace = inplace , regex = True , convert = convert
2457
2457
)
2458
2458
elif not (either_list or regex ):
2459
2459
return super ().replace (
2460
- to_replace , value , inplace = inplace , regex = regex , convert = convert ,
2460
+ to_replace , value , inplace = inplace , regex = regex , convert = convert
2461
2461
)
2462
2462
elif both_lists :
2463
2463
for to_rep , v in zip (to_replace , value ):
2464
2464
result_blocks = []
2465
2465
for b in blocks :
2466
2466
result = b ._replace_single (
2467
- to_rep , v , inplace = inplace , regex = regex , convert = convert ,
2467
+ to_rep , v , inplace = inplace , regex = regex , convert = convert
2468
2468
)
2469
2469
result_blocks = _extend_blocks (result , result_blocks )
2470
2470
blocks = result_blocks
@@ -2475,18 +2475,18 @@ def replace(self, to_replace, value, inplace=False, regex=False, convert=True):
2475
2475
result_blocks = []
2476
2476
for b in blocks :
2477
2477
result = b ._replace_single (
2478
- to_rep , value , inplace = inplace , regex = regex , convert = convert ,
2478
+ to_rep , value , inplace = inplace , regex = regex , convert = convert
2479
2479
)
2480
2480
result_blocks = _extend_blocks (result , result_blocks )
2481
2481
blocks = result_blocks
2482
2482
return result_blocks
2483
2483
2484
2484
return self ._replace_single (
2485
- to_replace , value , inplace = inplace , convert = convert , regex = regex ,
2485
+ to_replace , value , inplace = inplace , convert = convert , regex = regex
2486
2486
)
2487
2487
2488
2488
def _replace_single (
2489
- self , to_replace , value , inplace = False , regex = False , convert = True , mask = None ,
2489
+ self , to_replace , value , inplace = False , regex = False , convert = True , mask = None
2490
2490
):
2491
2491
"""
2492
2492
Replace elements by the given value.
0 commit comments