how to replace all nan value by the mean of the column dataframe code example Example: how to fill nas on a dataframe with median df.fillna(df.mean(), inplace=True)