title: Maximum Monthly Values whilst retaining the Data at which that values occurred
body: <p>I have daily rainfall data that looks like the following:</p>
  
  <pre><code>   Date           Rainfall (mm) 
  1922-01-01        0.0 
  1922-01-02        0.0 
  1922-01-03        0.0
  1922-01-04        0.0
  1922-01-05        31.5
  1922-01-06        0.0
  1922-01-07        0.0
  1922-01-08        0.0
  1922-01-09        0.0
  1922-01-10        0.0
  1922-01-11        0.0
  1922-01-12        9.1
  1922-01-13        6.4 
  </code></pre>
  
  <p>I am trying to work out the maximum value for each month for each year, and also what date the maximum value occurred on. I have been using the code:</p>
  
  <pre><code>rain_data.groupby(pd.Grouper(freq = 'M'))['Rainfall (mm)'].max()
  </code></pre>
  
  <p>This is returning the correct maximum value but returns the end date of each month rather than the date that maximum event occurred on.</p>
  
  <p>1974-11-30   0.0 
  
  <p><br>  <br>
  I have also tried using .idxmax(), but this also just return the end values of each month.</p>
  
  <p>Any suggestions on how I could get the correct date?</p>