title: pandas DataFrame.groupby and apply custom function
body: <p>I have a DataFrame with many duplicates (I need Type/StrikePrice pair to be unique) like this:</p>
  
  <pre><code>                   Pos  AskPrice
  Type  StrikePrice
  C     1500.0       10    281.6
  C     1500.0       11    281.9
  C     1500.0       12    281.7     &lt;- I need this one
  P     1400.0       30    1200.5
  P     1400.0       31    1250.2    &lt;- I need this one
  </code></pre>
  
  <p>How can I group by <code>Type + StrikePrice</code> and apply some logic (my own function) to decide which row from the group to choose (let's say by the most greater <code>Pos</code>)</p>
  
  <p>The expected result is</p>
  
  <pre><code>                   Pos  AskPrice
  Type  StrikePrice
  C     1500.0       12    281.7
  P     1400.0       31    1250.2
  </code></pre>
  
  <p>Thanks a lot!</p>