I have three different dataframes of economic measures. The columns are years and the rows are countries. I want to take each country's rows and form a dataframe for each country such that the columns are the three economic measures and the rows are years.
For example: Austria
GDP | CPI | Interest rate
1998 |xxxxxxxxxxx|xxxxxxxxxxx|xxxxxxxxxxxxxx
1999 |xxxxxxxxxxx|xxxxxxxxxxx|xxxxxxxxxxxxxx
I'm having trouble doing this in python because I am not sure how to manipulate rows.
Follow up question:
I now have a dataframe that looks something like this:
by_country: [
GDP | CPI | Interest rate
Country | Austria | Austria | Austria
1998 |xx xx xx xx|xx xx xx|xxxxxxxx
1998 |xx xx xx xx|xx xx xx|xxxxxxxx ......
GDP | CPI | Interest rate
Country | Belgium | Belgium | Belgium
1998 |xx xx xx xxx|xx xx xxx|xxxxxxxx
]
I want to be able to call stuff like this: Austria.GDP, Belgium.CPI, etc. I think the first step would be to define a function that calls the information for a country within the big dataframe such as by_country(Austria).
Essentially, I would like to be able to call country_df(Austria).GDP
Any thoughts on how to do this?