There is also an option to use dataframe where method:
df['new_col'] = df['col']
df['new_col'].where(df['new_col']!='Above Average', other='Good', inplace=True )
But to be clear np.where is the fastest way to go:
m = df['col'] == 'Above Average'
df['new_column'] = np.where(m, 'Good', df['col'])
df['new_column'] is the new column name. If mask m is True df['col'] will be assigned else 'Good'.
+----+---------------+
| | col |
|----+---------------|
| 0 | Nan |
| 1 | Above Average |
| 2 | 1.0 |
+----+---------------+
+----+---------------+--------------+
| | col | new_column |
|----+---------------+--------------|
| 0 | Nan | Nan |
| 1 | Above Average | Good |
| 2 | 1.0 | 1.0 |
+----+---------------+--------------+
I am also providing here some notes on masking when using the df.loc:
m = df['col']=='Above Average'
print(m)
df.loc[m, 'new_column'] = 'Good'
As you may see the result will be the same, but note how mask m is having the information where to read the value if m is False