I'm using a dataframe within a function to alter that dataframe. I get thrown this error:
The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
def hello(column):
if data['State'] == 'CA':
answer = column * 3
return answer
This is the outter thing I'm trying to do:
data['sup'] = data['Amount paid'].apply(hello, axis=1)
'State' is a series of states like CA, VA, NY etc. 'Amount paid' is a number.
I'm trying to make it so that if the State is CA, multiply that row's 'Amount paid' by 3.