pandas.DataFrame.bfill
pandas 3.1.1 · DataFrame · method
Fill a gap using the next available value along the selected direction.
Call syntax
DataFrame.bfill(*, axis=None, inplace=False, limit=None, limit_area=None)Run the example
Edit the example and select Run Python to see the result.
Parameters
| Parameter | Requirement | Accepted values and behavior |
|---|---|---|
axis |
Optional Keyword only Default None |
{0 or 'index'} for Series, {0 or 'index', 1 or 'columns'} for DataFrame Choose which axis the operation acts on. The accepted axis labels depend on the receiver. |
inplace |
Optional Keyword only Default False |
bool Choose whether to change the existing object. Where supported, an in-place call typically returns None. |
limit |
Optional Keyword only Default None |
int Set a maximum number of items affected by the operation. |
limit_area |
Optional Keyword only Default None |
{None, 'inside', 'outside'} Restrict filling to gaps inside or outside valid observations. |
Returns
Series/DataFrame