I have data that looks like this:
Currency Average Cost for two
0 Botswana Pula(P) 1100
1 Botswana Pula(P) 1200
2 Botswana Pula(P) 4000
3 Botswana Pula(P) 1500
4 Botswana Pula(P) 1500
I want to create a new column that will convert the cost to dollars. Just to mention, there are 12 currencies.
This is what I have written:
for i in range(len(df)) :
if(df[i]['Currency'] == 'Botswana Pula(P)'):
df[i]['new cost'] = df[i]['Average Cost for two'] * 0.095
if (df[i][['Currency'] == 'Brazilian Real(R$)']):
df[i]['new cost'] = df[i]['Average Cost for two'] * 0.266
and so on...
With this code, I have got an error.