pandas.api.extensions.ExtensionArray.fillna#

ExtensionArray.fillna(value, limit=None, copy=True)[source]#

Fill NA/NaN values using the specified method.

Parameters:
valuescalar, array-like

If a scalar value is passed it is used to fill all missing values. Alternatively, an array-like “value” can be given. It’s expected that the array-like have the same length as ‘self’.

limitint, default None

The maximum number of entries where NA values will be filled.

copybool, default True

Whether to make a copy of the data before filling. If False, then the original should be modified and no new memory should be allocated. For ExtensionArray subclasses that cannot do this, it is at the author’s discretion whether to ignore “copy=False” or to raise.

Returns:
ExtensionArray

With NA/NaN filled.

Examples

>>> arr = pd.array([np.nan, np.nan, 2, 3, np.nan, np.nan])
>>> arr.fillna(0)
<IntegerArray>
[0, 0, 2, 3, 0, 0]
Length: 6, dtype: Int64