pandas.Series.fillna

pandas 3.1.1 · Series and accessors · method

Replace missing values with supplied replacements, such as a scalar or values aligned by label.

Call syntax

Series.fillna(value, *, axis=None, inplace=False, limit=None)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
value Required
Positional or keyword
scalar, dict, Series, or DataFrame

Provide a scalar, mapping, or Series. Labeled replacements align to the original index.

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