title: How to get the max value of a multiple column group-by pandas?
body: <p>Iam trying to get the row with maximum value based on another column of a groupby, I am trying to follow the solutions given here <a href="https://stackoverflow.com/questions/15705630/python-how-can-i-get-the-row-which-has-the-max-value-in-goups-making-groupby">Python : Getting the Row which has the max value in groups using groupby</a>, however it doesn't work when you apply</p>
  
  <pre><code>annotations.groupby(['bookid','conceptid'], sort=False)['weight'].max()
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>bookid    conceptid
  12345678  3942     0.137271
            10673    0.172345
            1002     0.125136
  34567819  44407    1.370921
            5111     0.104729
            6160     0.114766
            200      0.151629
            3504     0.152793
  </code></pre>
  
  <p>But I'd like to get only the row with the highest weight, e.g., </p>
  
  <pre><code>bookid    conceptid
  12345678  10673    0.172345
  34567819  44407    1.370921
  </code></pre>
  
  <p>I'd appreciate any help</p>