title: Grouping DataFrame to get max index
body: <p>I'm having a dataframe similar to something like this:</p>
  
  <pre><code>    Year    class   Sales
  0   1980    1   1.10
  1   1980    2   7.07
  2   1980    3   8.00
  3   1980    4   12.00
  4   1981    1   11.20
  5   1981    1   2.00
  6   1981    3   4.00
  7   1981    2   6.00
  </code></pre>
  
  <p>I want my data to be grouped such that I get the yearly max sales of class and get the class of that dataframe. what I need to do after this?</p>
  
  <pre><code>data.groupby(['Year','class']).sum()
          Sales
  Year    class   
  1980    1   1.10
          2   7.07
          3   8.00
          4   12.00
  1981    1   13.20
          2   6.00
          3   4.00
  </code></pre>
  
  <p>e.g. I want my output to be something like this:</p>
  
  <pre><code>       Sales
  Year   class
  
  1980   4     12.00
  1981   1     13.20
  </code></pre>
  
  <p>I was able to get the correct output using loops but im trying to avoid that as it takes too much time.</p>