title: Pandas DataFrame find the max after Groupby two columns and get counts
body: <p>I have a dataframe df as following:</p>
  
  <pre><code>   userId  pageId  tag
  0  3122471  e852   18
  1  3122471  f3e2   18
  2  3122471  7e93   18
  3  3122471  2768    6
  4  3122471  53d9    6
  5  3122471  06d7   15
  6  3122471  e31c   15
  7  3122471  c6f3    2
  8  1234123  fjwe    1
  9  1234123  eiae    4
  10 1234123  ieha    4
  </code></pre>
  
  <p>After using <code>df.groupby(['userId', 'tag'])['pageId'].count()</code> to group the data by userId and tag . 
  I will get:</p>
  
  <pre><code>userId   tag
  3122471  2      1
           6      2
           15     2
           18     3
  1234123   1     1
            4     2
  </code></pre>
  
  <p>Now I want to find the tag that each user has the most.
  Just as following:</p>
  
  <pre><code>userId   tag
  3122471  18
  1234123   4
  </code></pre>
  
  <p>(Note: if there are multiple tags that has the same count, I want to use a function <code>my_rule</code> to determine which to show)</p>