@@ -7099,6 +7099,8 @@ def fillna(
7099
7099
7100
7100
See Also
7101
7101
--------
7102
+ ffill : Fill values by propagating the last valid observation to next valid.
7103
+ bfill : Fill values by using the next valid observation to fill the gap.
7102
7104
interpolate : Fill NaN values using interpolation.
7103
7105
reindex : Conform object to new index.
7104
7106
asfreq : Convert TimeSeries to specified frequency.
@@ -7358,7 +7360,10 @@ def ffill(
7358
7360
...
7359
7361
7360
7362
@final
7361
- @doc (klass = _shared_doc_kwargs ["klass" ])
7363
+ @doc (
7364
+ klass = _shared_doc_kwargs ["klass" ],
7365
+ axes_single_arg = _shared_doc_kwargs ["axes_single_arg" ],
7366
+ )
7362
7367
def ffill (
7363
7368
self ,
7364
7369
* ,
@@ -7370,6 +7375,27 @@ def ffill(
7370
7375
"""
7371
7376
Fill NA/NaN values by propagating the last valid observation to next valid.
7372
7377
7378
+ Parameters
7379
+ ----------
7380
+ axis : {axes_single_arg}
7381
+ Axis along which to fill missing values. For `Series`
7382
+ this parameter is unused and defaults to 0.
7383
+ inplace : bool, default False
7384
+ If True, fill in-place. Note: this will modify any
7385
+ other views on this object (e.g., a no-copy slice for a column in a
7386
+ DataFrame).
7387
+ limit : int, default None
7388
+ If method is specified, this is the maximum number of consecutive
7389
+ NaN values to forward/backward fill. In other words, if there is
7390
+ a gap with more than this number of consecutive NaNs, it will only
7391
+ be partially filled. If method is not specified, this is the
7392
+ maximum number of entries along the entire axis where NaNs will be
7393
+ filled. Must be greater than 0 if not None.
7394
+ downcast : dict, default is None
7395
+ A dict of item->dtype of what to downcast if possible,
7396
+ or the string 'infer' which will try to downcast to an appropriate
7397
+ equal type (e.g. float64 to int64 if possible).
7398
+
7373
7399
Returns
7374
7400
-------
7375
7401
{klass} or None
@@ -7437,7 +7463,7 @@ def pad(
7437
7463
downcast : dict | None | lib .NoDefault = lib .no_default ,
7438
7464
) -> Self | None :
7439
7465
"""
7440
- Synonym for :meth:`DataFrame.fillna` with ``method='ffill'`` .
7466
+ Fill NA/NaN values by propagating the last valid observation to next valid .
7441
7467
7442
7468
.. deprecated:: 2.0
7443
7469
@@ -7494,7 +7520,10 @@ def bfill(
7494
7520
...
7495
7521
7496
7522
@final
7497
- @doc (klass = _shared_doc_kwargs ["klass" ])
7523
+ @doc (
7524
+ klass = _shared_doc_kwargs ["klass" ],
7525
+ axes_single_arg = _shared_doc_kwargs ["axes_single_arg" ],
7526
+ )
7498
7527
def bfill (
7499
7528
self ,
7500
7529
* ,
@@ -7504,7 +7533,28 @@ def bfill(
7504
7533
downcast : dict | None | lib .NoDefault = lib .no_default ,
7505
7534
) -> Self | None :
7506
7535
"""
7507
- Synonym for :meth:`DataFrame.fillna` with ``method='bfill'``.
7536
+ Fill NA/NaN values by using the next valid observation to fill the gap.
7537
+
7538
+ Parameters
7539
+ ----------
7540
+ axis : {axes_single_arg}
7541
+ Axis along which to fill missing values. For `Series`
7542
+ this parameter is unused and defaults to 0.
7543
+ inplace : bool, default False
7544
+ If True, fill in-place. Note: this will modify any
7545
+ other views on this object (e.g., a no-copy slice for a column in a
7546
+ DataFrame).
7547
+ limit : int, default None
7548
+ If method is specified, this is the maximum number of consecutive
7549
+ NaN values to forward/backward fill. In other words, if there is
7550
+ a gap with more than this number of consecutive NaNs, it will only
7551
+ be partially filled. If method is not specified, this is the
7552
+ maximum number of entries along the entire axis where NaNs will be
7553
+ filled. Must be greater than 0 if not None.
7554
+ downcast : dict, default is None
7555
+ A dict of item->dtype of what to downcast if possible,
7556
+ or the string 'infer' which will try to downcast to an appropriate
7557
+ equal type (e.g. float64 to int64 if possible).
7508
7558
7509
7559
Returns
7510
7560
-------
@@ -7583,7 +7633,7 @@ def backfill(
7583
7633
downcast : dict | None | lib .NoDefault = lib .no_default ,
7584
7634
) -> Self | None :
7585
7635
"""
7586
- Synonym for :meth:`DataFrame.fillna` with ``method='bfill'`` .
7636
+ Fill NA/NaN values by using the next valid observation to fill the gap .
7587
7637
7588
7638
.. deprecated:: 2.0
7589
7639
0 commit comments