This is my dataframe. I want to create a new column named mpg_high
The condition of the column is:
mpg_high = 1 if mpg > average mpg (this is the mean of mpg where I placed np.mean(df.mpg) else = 0.
I tried various methods but kept getting syntax errors. How can I do this?
Thanks in advance
