I have data that looks like this:

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.

Python Pandas Tutorial - Data Analysis with Python Pandas will help you get started with Python Pandas Library for various applications including Data analysis. You'll learn: Introduction to Pandas; DataFrames and Series; How To View Data? Selecting Data; Handling Missing Data; Pandas Operations; Merge, Group, Reshape Data; Time Series And Categoricals; Plotting Using Pandas

Python Pandas Tutorial will help you get started with Python Pandas Library for various applications including Data analysis. Introduction to Pandas. DataFrames and Series. How To View Data? Selecting Data. Handling Missing Data. Pandas Operations. Merge, Group, Reshape Data. Time Series And Categoricals. Plotting Using Pandas

After analyzing clients and market requirements, TopDevelopers has come up with the list of the best Python service providers. These top-rated Python developers are widely appreciated for their professionalism in handling diverse projects. When...