I have a dataframe that look like this:
Letter num
A 5
B 4
A 3
B 3
I want to add 3 if letter = A and 2 if letter = B I tried this:
for i in df:
if df['Letter'] == A:
df['num'] = df['num'] + 3
else:
df['num'] = df['num'] + 2
but i get this: ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().