I have a dataframe containg two columns, with country's names, and a value. I would now want that e.g. country "Italy" and all others, are columns, and than the values to be shown for each year under the country they belong to.
I want the dataframe to look like this:
Italy | Spain | |
---|---|---|
2020 | 1246 | 64829 |
2021 | 230 | 11320 |
Instead, it looks like this:
Country | Value | |
---|---|---|
ITA-20 | Italy | 1246 |
ITA-21 | Italy | 230 |
SPA-20 | Spain | 64829 |
SPA-21 | Spain | 11320 |
So, basically I want that instead of every country plus year to be only year written, and than the countries are written in the columns. I would be very happy if anyone could help me. Thank you a lot in advance! :)