title: Pandas: for groupby value_counts, return the row(s) with the maximum count
body: <p>I want to do almost the same thing as <a href="https://stackoverflow.com/questions/35364601/group-by-and-find-top-n-value-counts-pandas">this question</a>.</p>
  
  <p>However, the approach in the accepted answer by @jezrael takes way too long based on my dataset -- I have ~300k rows in the original dataframe, and it takes a few minutes to run the nlargest(1) command. Furthermore, I tried it on a head(1000) limited dataframe, and didn't get only 1 row for each within the value_count -- I got exactly the same Series back as the value_counts.</p>
  
  <p><strong>In my own words:</strong> Basically, my dataset has two columns like this:</p>
  
  <pre><code>Session Rating
  A       Positive
  A       Positive
  A       Positive
  A       Negative
  B       Negative
  B       Negative
  C       Positive
  C       Negative
  </code></pre>
  
  <p>Using counts = df.groupby('Session')['Rating'].value_counts() I get a Series object like this:</p>
  
  <pre><code>Session Rating
  A       Positive  3
          Negative  1
  B       Negative  2
  C       Positive  1
          Negative  1
  </code></pre>
  
  <p>How do I get a dataframe where just the Rating with the max count is included? And in cases where there are multiple maxes (such as C), I would like to exclude that one from the returned table.</p>