How to replace Null values using Pandas• 2 min
The Pandas library will give you the tools to replace the Null values the same way as replacing NaN values.
The .fillna() method will replace all Null values in contained in a pandas.Series ou pandas.DataFrame.
The method takes multiple arguments such as
The value you want to replace the Null with.
The method of fill. Can be forward fill as "ffill", backward fill as "bfill".
The axis you want to perform the operation on, it works only when given a DataFrame.
An example on a Serie
An example on a DataFrame
Here you are, you know how to replace your Null by a specific value !
If you want to learn more about Backfill or Forward Fill, you can check the links below