title: Pandas: index of max value for each group
body: <p>My Pandas DataFrame, <code>df</code>, looks like this:</p>
  
  <pre><code>parameter1   parameter2   value
  
  1            1            0.1
               2            0.2
  
  2            1            0.6
               2            0.3
  </code></pre>
  
  <p><code>value</code> is the result of a <code>groupby(['parameter1','parameter2']).mean()</code> on another <code>DataFrame</code>. Now, I can find the maximum value of <code>value</code> for each value of <code>parameter1</code> using</p>
  
  <pre><code>df.max(level='parameter1')
  </code></pre>
  
  <p>However, I need to find the corresponding value of <code>parameter2</code> for this maximum value. It seems <code>df.idxmax()</code> does not support <code>level=</code>, so how can I do this instead?</p>