title: group rows with same id, pandas/python
body: <p>Here is the original data set</p>
  
  <pre><code>id         firstname    lastname      email               update date
  A1         wendy         smith         ws@mail.com        2018-01-02
  A1         wendy         smith         smith@mail.com     2019-02-03 
  A2         harry         lynn          lynn@mail.com      2016-04-03
  A2         harry                       harylynn@mail.com  2019-03-12
  A3         tinna         dickey        tinna@mail.com      2016-04-03
  A3         tinna         dickey        776-3384-333       2019-03-12
  </code></pre>
  
  <p>my design is to group rows with same id, if some columns with same id contain different values, keep the latest one.
  So the result should be like this:</p>
  
  <pre><code>id         firstname    lastname      email               update date
  A1         wendy         smith         smith@mail.com     2019-02-03 
  A2         harry         lynn          harylynn@mail.com  2019-03-12
  A3         tinna         dickey        tinna@mail.com      2019-03-12
  </code></pre>
  
  <p>currently, I try to use pandas groupby to group cell with the same value and keep different values in one cell separated by "," for later use(remove earlier data, make one cell one data ). BUt, I think what I am doing is not right... </p>
  
  <pre><code>df=df.groupby(['id']).agg({'first_name': lambda x:','.join(set(x))})
  </code></pre>
  
  <p>What if the latest value is a wrong value, do I need to store the conflict value to a new column for latter clean?</p>
  
  <p>Any help will be appreciated!   </p>