how to fill na with nan values in pandas code example
Example 1: how to fill nan values with mean in pandas
df.fillna(df.mean())
Example 2: dataframe fill nan with mode
df['Column_Name'].fillna(df['Column_Name'].mode()[0], inplace=True)
df.fillna(df.mean())
df['Column_Name'].fillna(df['Column_Name'].mode()[0], inplace=True)