title: pandas sort values to get top 5 for each column in a groupby
body: <p>I have a dataframe with city, name and members. I need to find the top 5 groups (name) in terms of highest member ('members') count per city. </p>
  
  <p>This is what I get when I use:</p>
  
  <p><code>clust.groupby(['city','name']).agg({'members':sum})</code></p>
  
  <p><code>members
  city                                   name 
  Bath         AWS Bath User Group        346
               Agile Bath &amp; Bristol        957
  Bath         Crypto Chat                 47
  Bath         JS                          142
  Bath         Machine Learning Meetup     435
  Belfast      4th Industrial Revolution Challenge    609
  Belfast      Adobe Meetup                         66
  Belfast      Azure Meetup                        205
  Southampton  Crypto Currency Trading SouthCoast 50
  Southampton Bitcoin and Altcoin Meetup          50
  Southampton Functional Programming Meetup       28
  Southampton Virtual Reality Meetup              248
  Sunderland  Sunderland Digital  287</code></p>
  
  <p>I need the top 5 but as you can see the member count doesn't seem to be ordered, i.e. 346 before 957 etc.</p>
  
  <p>I've also tried sorting the values before-hand and do:</p>
  
  <p><code>clust.sort_values(['city', 'name'], axis=0).groupby('city').head(5)</code></p>
  
  <p>But that returns a similar series. </p>
  
  <p>I've used this one too <code>clust.groupby(['city', 'name']).head(5)</code> </p>
  
  <p>but it gives me all the rows and not top 5. It also isn't structured so not in alphabetical order. </p>
  
  <p>Please help. Thanks</p>