I have a data frame that is currently set up with Country Name, Indicator Name, and the corresponding Years as columns. I'd like to pivot the data frame so the Indicators are the column variables, while grouping by the Country Name's and their corresponding years.
I have tried:
df.pivot(index = 'Country Name', columns = 'Indicator Name', values = df.columns[2:])
However, this uses each year as a column with each indicator under it. Any ideas on how to fix this?
Country Data Frame: