Articles → Pandas → Fillna Function In Pandas
Fillna Function In Pandas
Purpose
Example
import numpy as np
import pandas as pd
# Create a list
list = [[1,2,3], [4,np.nan,6], [7, np.nan, np.nan]]
df = pd.DataFrame(list)
print("Initial\n", df)
df = df.fillna("FILL VALUE")
print("\nAfter \n", df)
Output
Click to Enlarge