title: pandas groupby consecutive dates and multiple conditions
body: <p>I have this table wherein I would like to merge two rows together where <br>
  <code>end_date[-1]= start_date[0] AND trained[-1] = trained[0]</code></p>
  <p>Optional: I also would like to retain the values of re, id, and name where diff is max.</p>
  <pre><code>use trained start       end          diff   re  id  name
  a   FALSE   01/12/2010  03/01/2018   2,590  0   4   25
  a   TRUE    03/01/2018  08/02/2019   401    0   4   25
  a   TRUE    08/02/2019  09/02/2019   1      0   4   25
  a   TRUE    09/02/2019  31/12/2019   325    1   4   25
  b   FALSE   01/08/2016  15/05/2018   652    0   5   8
  c   FALSE   01/07/2019  06/08/2019   36     0   4   4
  c   TRUE    06/08/2019  18/05/2020   286    0   4   4
  c   TRUE    18/05/2020  19/05/2020   1      0   4   4
  c   TRUE    19/05/2020  01/09/2020   105    0   4   4
  c   TRUE    01/09/2020  31/12/2019   (245)  1   4   15
  </code></pre>
  <p>goal:</p>
  <pre><code>use trained start       end          diff   re  id  name
  a   FALSE   01/12/2010  03/01/2018   2,590  0   4   25
  a   TRUE    03/01/2018  31/12/2019   727    0   4   25
  b   FALSE   01/08/2016  15/05/2018   652    0   5   8
  c   FALSE   01/07/2019  06/08/2019   36     0   4   4
  c   TRUE    06/08/2019  31/12/2019   147    0   4   4
  </code></pre>