title: pandas groupby and adding new column
body: <p>I am trying to filter a dataframe which has 3 columns and what I'm trying to do is: group by col1 and col2 and get the max value of col3 and also get second max value of col3 but insert it as a new column: col 4</p>
  
  <p>I was able to group it using the below but don't know how to get the second max and insert it as another column:</p>
  
  <pre><code>grouped = df.groupby(['COL1', 'COL2']).agg({'COL3': 'max'})
  
     COL1  COL2  COL3
  0   A    1      0.2 
  1   A    1      0.4
  3   B    4      0.7   
  </code></pre>
  
  <p>Wanted output:</p>
  
  <pre><code>   COL1  COL2  COL3  COL4
  0   A    1      0.4  0.2
  3   B    4      0.7  0.7 
  </code></pre>