@@ -2555,7 +2555,7 @@ def notna(self) -> npt.NDArray[np.bool_]:
2555
2555
2556
2556
notnull = notna
2557
2557
2558
- def fillna (self , value = None , downcast = lib . no_default ):
2558
+ def fillna (self , value = None ):
2559
2559
"""
2560
2560
Fill NA/NaN values with the specified value.
2561
2561
@@ -2564,12 +2564,6 @@ def fillna(self, value=None, downcast=lib.no_default):
2564
2564
value : scalar
2565
2565
Scalar value to use to fill holes (e.g. 0).
2566
2566
This value cannot be a list-likes.
2567
- downcast : dict, default is None
2568
- A dict of item->dtype of what to downcast if possible,
2569
- or the string 'infer' which will try to downcast to an appropriate
2570
- equal type (e.g. float64 to int64 if possible).
2571
-
2572
- .. deprecated:: 2.1.0
2573
2567
2574
2568
Returns
2575
2569
-------
@@ -2588,28 +2582,13 @@ def fillna(self, value=None, downcast=lib.no_default):
2588
2582
"""
2589
2583
if not is_scalar (value ):
2590
2584
raise TypeError (f"'value' must be a scalar, passed: { type (value ).__name__ } " )
2591
- if downcast is not lib .no_default :
2592
- warnings .warn (
2593
- f"The 'downcast' keyword in { type (self ).__name__ } .fillna is "
2594
- "deprecated and will be removed in a future version. "
2595
- "It was previously silently ignored." ,
2596
- FutureWarning ,
2597
- stacklevel = find_stack_level (),
2598
- )
2599
- else :
2600
- downcast = None
2601
2585
2602
2586
if self .hasnans :
2603
2587
result = self .putmask (self ._isnan , value )
2604
- if downcast is None :
2605
- # no need to care metadata other than name
2606
- # because it can't have freq if it has NaTs
2607
- # _with_infer needed for test_fillna_categorical
2608
- return Index ._with_infer (result , name = self .name )
2609
- raise NotImplementedError (
2610
- f"{ type (self ).__name__ } .fillna does not support 'downcast' "
2611
- "argument values other than 'None'."
2612
- )
2588
+ # no need to care metadata other than name
2589
+ # because it can't have freq if it has NaTs
2590
+ # _with_infer needed for test_fillna_categorical
2591
+ return Index ._with_infer (result , name = self .name )
2613
2592
return self ._view ()
2614
2593
2615
2594
def dropna (self , how : AnyAll = "any" ) -> Self :
0 commit comments