df = pd.DataFrame({
"Color": ["red", "red", "blue"],
"Width": ["wide", "narrow", "narrow"],
"Weight": [12, 12, 12],
})
Color Width Weight
0 red wide 12
1 red narrow 12
2 blue narrow 12
I'd like to add a new column EffWeight,
EffWeight = Weight if Color == 'red' and Width == 'wide' else 0
Color Width Weight EffWeight
0 red wide 12 12
1 red narrow 12 0
2 blue narrow 12 0
How do I do that?