fillna() with Pandas Series
Let's find out how to use the fillna() function.
We'll cover the following...
We'll cover the following...
Try it yourself
Try executing the code below to see the result.
Press + to interact
Python 3.8
import numpy as npimport pandas as pds = pd.Series([1, 2, np.nan, 4, 5])s.fillna(3)print(s.sum())
Explanation
The pandas.Series.fillna
documentation says, that it returns the following:
"Returns: Series or None
Object with missing values ...