I have an issue that relates to the following example. Given a dataframe which looks like this
Country Population
Date
2016-01-01 A 10
2016-01-01 B 100
2016-01-01 C 1000
2016-01-01 D 10000
2017-01-01 A 20
2017-01-01 B 200
2017-01-01 C 2000
2017-01-01 D 20000
2018-01-01 A 30
2018-01-01 B 300
2018-01-01 C 3000
2018-01-01 D 30000
I wish to have the output looking like this
A B C D
2016-01-01 10 100 1000 10000
2017-01-01 20 200 2000 20000
2018-01-01 30 200 3000 30000
The problem is I have a very large dataset (22.000+ rows) with the string column (Country) being of many different strings, where I may not know all of the different strings.
I've tried working around with the function .groupby() but unsuccessful. Any ideas how to get the result?