Required task
I have the following DataFrame
and I want to get the data to simply have the unique count changes of the Rating
for each id
date Rating id
0 2019-12-31 A 1
1 2019-12-31 B 2
2 2019-11-30 A 1
3 2019-11-30 A 2
4 2019-10-31 B 1
5 2019-10-31 A 2
6 2019-09-30 C 1
7 2019-09-30 A 2
8 2019-08-31 B 1
9 2019-08-31 B 2
Goal
id Rating Unique Count
1 A 1
1 B 2
1 C 1
2 A 1
2 B 2
The above DataFrame
is simply an example, I am not exactly sure how it would look it pandas. Any help would be awesome!