import numpy as np
import pandas as pd
df = pd.DataFrame([[np.nan, 2, 1, 0],
[3, 4, np.nan, 1],
[np.nan, np.nan, 8, 5],
[np.nan, 3, np.nan, 4]],
columns=list('ABCD'))
df2 = df
df.fillna(value = df.mean(), inplace=True)
Now df2 and df are identical. How do I avoid changing df2?