title: Find the row associated with maximum date after groupby in Pandas
body: <p>I have a pandas DataFrame with 3 columns containing a PERSON_ID, MOVING_DATE AND PLACE as follows:</p>
  
  <pre><code>df = pandas.DataFrame(
  [[1,datetime.datetime(2018, 1, 1), 'New York'], 
   [1, datetime.datetime(2018, 1, 20), 'Rio de Janeiro'],
   [1, datetime.datetime(2018, 2, 13), 'London'],
   [2, datetime.datetime(2017, 6, 12), 'Seatle'],
   [2, datetime.datetime(2016, 10, 10), 'New Mexico'],
   [3, datetime.datetime(2017, 9, 19), 'Sao Paulo'],
   [3, datetime.datetime(2015, 12, 11), 'Bangladesh']]],
  columns=['PERSON ID', 'MOVING DATE', 'PLACE']
  )
  
     PERSON ID MOVING DATE           PLACE
  0          1  2018-01-01        New York
  1          1  2018-01-20  Rio de Janeiro
  2          1  2018-02-13          London
  3          2  2017-06-12          Seatle
  4          2  2016-10-10      New Mexico
  5          3  2017-09-19       Sao Paulo
  6          3  2015-12-11      Bangladesh
  </code></pre>
  
  <p>I would like to find the place where the person is based on its last movement date (MOVEMENT_DATE).</p>
  
  <p>Is it possible to get the result with the <strong>groupby</strong> method?</p>
  
  <p>So far, I've tried:</p>
  
  <pre><code>df = df.sort_values(['PERSON ID', 'MOVING DATE'])
  df.groupby(['PERSON ID', 'MOVING DATE']).agg(
       {'MOVING DATE': max, 'PLACE': 'last'}
  )
  </code></pre>
  
  <p>but it didn't work out.
  Any help would be appreciated.</p>
  
  <p>Thanks in advance,</p>
  
  <p>Rhenan</p>