I am trying to group by multiple columns and rank them by count and get the top record for each group.However when I call the groupby I get the following error.