title: Pandas: aggregate column based on values in a different column
body: <p>Lets say I start with a dataframe that looks like this:</p>
  
  <pre><code>    Group   Val     date
  0   home    first   2017-12-01
  1   home    second  2017-12-02
  2   away    first   2018-03-07
  3   away    second  2018-03-01
  </code></pre>
  
  <p>Data types are [string, string, datetime]. I would like to get a dataframe that for each group, shows me the value that was entered most recently:</p>
  
  <pre><code>    Group   Most rececnt Val    Most recent date
  0   home    second              12-02-2017
  1   away    first               03-07-2018
  </code></pre>
  
  <p>(Data types are [string, string, datetime])</p>
  
  <p>My initial thought is that I should be able to do something like this by grouping by 'group' and then aggregating the dates and vals. I know I can get the most recent datetime using the 'max' agg function, but I'm stuck on what function to use to get the corresponding val:</p>
  
  <pre><code>df.groupby('Group').agg({'val':lambda x: ____????____
                       'date':'max'})
  </code></pre>
  
  <p>Thanks,</p>