How to pivot a dataframe in Pandas? [duplicate]
This is a guess: it's not a ".csv" file, but a Pandas DataFrame imported from a '.csv'.
To pivot this table you want three arguments in your Pandas "pivot". e.g., if df
is your dataframe:
table = df.pivot(index='Country',columns='Year',values='Value') print (table)
This should should give the desired output.