df['color'] = ['red' if x == 'Z' else 'green' for x in df['Set']]
import pandas as pd
import numpy as np
df = pd.DataFrame({'Type':list('ABBC'), 'Set':list('ZZXY')})
df['color'] = np.where(df['Set']=='Z', 'green', 'red')
print(df)
df.loc[df['column name'] condition, 'new column name'] = 'value if condition is met'