I have a pandas dataframe as follows.
time location count
2022-05-01 A 1
2022-05-01 B 2
2022-05-01 C 3
2022-05-01 D 4
2022-05-02 A 5
2022-05-02 B 6
2022-05-02 C 7
2022-05-02 D 8
I want to transform the dataframe as below.
time A B C D
2022-05-01 1 2 3 4
2022-05-02 5 6 7 8