pandas.Index.fillna#
- Index.fillna(value)[source]#
Fill NA/NaN values with the specified value.
- Parameters:
- valuescalar
Scalar value to use to fill holes (e.g. 0).This value cannot be a list-likes.
- Returns:
- Index
NA/NaN values replaced withvalue.
See also
DataFrame.fillnaFill NaN values of a DataFrame.
Series.fillnaFill NaN Values of a Series.
Examples
>>>idx=pd.Index([np.nan,np.nan,3])>>>idx.fillna(0)Index([0.0, 0.0, 3.0], dtype='float64')
On this page