@@ -7079,6 +7079,8 @@ def fillna(
7079
7079
7080
7080
See Also
7081
7081
--------
7082
+ ffill : Fill values by propagating the last valid observation to next valid.
7083
+ bfill : Fill values by using the next valid observation to fill the gap.
7082
7084
interpolate : Fill NaN values using interpolation.
7083
7085
reindex : Conform object to new index.
7084
7086
asfreq : Convert TimeSeries to specified frequency.
@@ -7338,7 +7340,10 @@ def ffill(
7338
7340
...
7339
7341
7340
7342
@final
7341
- @doc (klass = _shared_doc_kwargs ["klass" ])
7343
+ @doc (
7344
+ klass = _shared_doc_kwargs ["klass" ],
7345
+ axes_single_arg = _shared_doc_kwargs ["axes_single_arg" ],
7346
+ )
7342
7347
def ffill (
7343
7348
self ,
7344
7349
* ,
@@ -7350,6 +7355,27 @@ def ffill(
7350
7355
"""
7351
7356
Fill NA/NaN values by propagating the last valid observation to next valid.
7352
7357
7358
+ Parameters
7359
+ ----------
7360
+ axis : {axes_single_arg}
7361
+ Axis along which to fill missing values. For `Series`
7362
+ this parameter is unused and defaults to 0.
7363
+ inplace : bool, default False
7364
+ If True, fill in-place. Note: this will modify any
7365
+ other views on this object (e.g., a no-copy slice for a column in a
7366
+ DataFrame).
7367
+ limit : int, default None
7368
+ If method is specified, this is the maximum number of consecutive
7369
+ NaN values to forward/backward fill. In other words, if there is
7370
+ a gap with more than this number of consecutive NaNs, it will only
7371
+ be partially filled. If method is not specified, this is the
7372
+ maximum number of entries along the entire axis where NaNs will be
7373
+ filled. Must be greater than 0 if not None.
7374
+ downcast : dict, default is None
7375
+ A dict of item->dtype of what to downcast if possible,
7376
+ or the string 'infer' which will try to downcast to an appropriate
7377
+ equal type (e.g. float64 to int64 if possible).
7378
+
7353
7379
Returns
7354
7380
-------
7355
7381
{klass} or None
@@ -7417,7 +7443,7 @@ def pad(
7417
7443
downcast : dict | None | lib .NoDefault = lib .no_default ,
7418
7444
) -> Self | None :
7419
7445
"""
7420
- Synonym for :meth:`DataFrame.fillna` with ``method='ffill'`` .
7446
+ Fill NA/NaN values by propagating the last valid observation to next valid .
7421
7447
7422
7448
.. deprecated:: 2.0
7423
7449
@@ -7474,7 +7500,10 @@ def bfill(
7474
7500
...
7475
7501
7476
7502
@final
7477
- @doc (klass = _shared_doc_kwargs ["klass" ])
7503
+ @doc (
7504
+ klass = _shared_doc_kwargs ["klass" ],
7505
+ axes_single_arg = _shared_doc_kwargs ["axes_single_arg" ],
7506
+ )
7478
7507
def bfill (
7479
7508
self ,
7480
7509
* ,
@@ -7484,7 +7513,28 @@ def bfill(
7484
7513
downcast : dict | None | lib .NoDefault = lib .no_default ,
7485
7514
) -> Self | None :
7486
7515
"""
7487
- Synonym for :meth:`DataFrame.fillna` with ``method='bfill'``.
7516
+ Fill NA/NaN values by using the next valid observation to fill the gap.
7517
+
7518
+ Parameters
7519
+ ----------
7520
+ axis : {axes_single_arg}
7521
+ Axis along which to fill missing values. For `Series`
7522
+ this parameter is unused and defaults to 0.
7523
+ inplace : bool, default False
7524
+ If True, fill in-place. Note: this will modify any
7525
+ other views on this object (e.g., a no-copy slice for a column in a
7526
+ DataFrame).
7527
+ limit : int, default None
7528
+ If method is specified, this is the maximum number of consecutive
7529
+ NaN values to forward/backward fill. In other words, if there is
7530
+ a gap with more than this number of consecutive NaNs, it will only
7531
+ be partially filled. If method is not specified, this is the
7532
+ maximum number of entries along the entire axis where NaNs will be
7533
+ filled. Must be greater than 0 if not None.
7534
+ downcast : dict, default is None
7535
+ A dict of item->dtype of what to downcast if possible,
7536
+ or the string 'infer' which will try to downcast to an appropriate
7537
+ equal type (e.g. float64 to int64 if possible).
7488
7538
7489
7539
Returns
7490
7540
-------
@@ -7563,7 +7613,7 @@ def backfill(
7563
7613
downcast : dict | None | lib .NoDefault = lib .no_default ,
7564
7614
) -> Self | None :
7565
7615
"""
7566
- Synonym for :meth:`DataFrame.fillna` with ``method='bfill'`` .
7616
+ Fill NA/NaN values by using the next valid observation to fill the gap .
7567
7617
7568
7618
.. deprecated:: 2.0
7569
7619
0 commit comments