I have this dataframe 

```
          STATE              County            POP
1       Alabama      Autauga County          54571
2       Alabama      Baldwin County         182265
3       Alabama      Barbour County          27457
4       Alabama         Bibb County          22915
5       Alabama       Blount County          57322
6       Alabama      Bullock County          10914
7       Alabama       Butler County          20947
8       Alabama      Calhoun County         118572
...
3162  Wisconsin     Washburn County          15911
3163  Wisconsin   Washington County         131887
3164  Wisconsin     Waukesha County         389891
3165  Wisconsin      Waupaca County          52410
3166  Wisconsin     Waushara County          24496
3167  Wisconsin    Winnebago County         166994
3168  Wisconsin         Wood County          74749
....
3182    Wyoming      Natrona County          75450
3183    Wyoming     Niobrara County           2484
3184    Wyoming         Park County          28205
3185    Wyoming       Platte County           8667
3186    Wyoming     Sheridan County          29116

```

How do I group the data by state and county to display the top 3 county of each state ?

```
    STATE              COUNTY            POP
  Alabama      Baldwin County         182265
               Calhoun County          18572
                Blount County          57322
Wisconsin     Waukesha County         389891
             Winnebago County         166994
            Washington County         131887
  Wyoming         Park County          28205
               Natrona County          75450
              Sheridan County          29116

```

I tried

```
df.sort_values('POP',ascending=False).groupby(['STATE','COUNTY']).sum().head(3)

```

but it only shows first 3 entries but I wanted the top 3 for each group

```
                         POP
  STATE         COUNTY
Alabama Autauga County  54571
        Baldwin County  182265
        Barbour County  27457

```