I thought this was going to be super straight forward but I'm stuck. I've tried to group by in several different ways as well as creating a .diff() column and looping through unique names, but I still can't get it to work.
The most I've gotten is to have the first "date sandwich" but then the rest gets ignored.
Basically I have a table that looks like this:
Name
Bob Smith 6/1/2020
Bob Smith 6/2/2020
Bob Smith 6/3/2020
Bob Smith 6/10/2020
Bob Smith 6/11/2020
Bob Smith 6/12/2020
Bob Smith 6/13/2020
Joe Doe 5/20/2020
Joe Doe 5/21/2020
Joe Doe 5/22/2020
Joe Doe 5/23/2020
Joe Doe 6/4/2020
Joe Doe 6/5/2020
Joe Doe 6/6/2020
Mark Scott 6/18/2020
Mark Scott 6/19/2020
And I wanted to extract the start and end dates for each consecutive date streak:
Name: From: To:
Bob Smith 6/1/2020 6/3/2020
Bob Smith 6/10/2020 6/13/2020
Joe Doe 5/20/2020 5/23/2020
Joe Doe 6/4/2020 6/6/2020
Mark Scott 6/18/2020 6/19/2020
Thanks in advance for any help!