Directly use df.fillna(df.mean())
to fill all the null value with mean
If you want to fill null value with mean of that column then you can use this
suppose x=df['Item_Weight']
here Item_Weight
is column name
here we are assigning (fill null values of x with mean of x into x)
df['Item_Weight'] = df['Item_Weight'].fillna((df['Item_Weight'].mean()))
If you want to fill null value with some string then use
here Outlet_size
is column name
df.Outlet_Size = df.Outlet_Size.fillna('Missing')