pandas.DataFrame.fillna
pandas 3.1.1 · DataFrame · method
Replace missing values with supplied replacements, such as a scalar or values aligned by label.
Call syntax
DataFrame.fillna(value, *, axis=None, inplace=False, limit=None)Run the example
Edit the example and select Run Python to see the result.
Parameters
| Parameter | Requirement | Accepted values and behavior |
|---|---|---|
value |
Required Positional or keyword |
scalar, dict, Series, or DataFrame Provide a scalar, a mapping keyed by column, a Series, or a DataFrame. Labeled values align with the input. |
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. |
Returns
Series/DataFrame