df.fillna(df.mean(), inplace=True)

Read more of this post