test= pd.DataFrame({'Year':['2016','2016','2016','2017','2017','2017']
,'Country' : ['NL','GR','AU','NL','GB','BR']
,'Count' : ['100','200','5','1000','2000','3']})
df;
Year Country Count
0 2016 NL 100
1 2016 GR 200
2 2016 AU 5
3 2017 NL 1000
4 2017 GB 2000
5 2017 BR 3
I would like to select the top 2 entries based on Column Count and Year.
such as
Year Country Count
0 2016 NL 100
1 2016 GR 200
3 2017 NL 1000
4 2017 GB 2000
So for each year I want to see the top 2 countries. Any idea?