I want to aggregate the continuous time intervals and count them for each person in pandas.
As an example I have dataframe that looks like this:
Name Time
0 Bob 10:59:00
1 Bob 11:00:00
2 Bob 11:01:00
3 Bob 11:14:00
4 Bob 11:15:00
5 Bob 11:17:00
6 Bob 11:18:00
7 Bob 11:19:00
8 Bob 13:10:00
9 Bob 13:10:00
10 Bob 13:15:00
11 Bob 13:16:00
12 Bob 13:17:00
13 Bob 13:18:00
14 Bob 13:19:00
15 Alice 13:17:00
16 Alice 13:18:00
17 Alice 13:19:00
With the following output:
Note: I only need the count not the time intervals themselves.
Bob = 5
1. 10:59 - 11:01
2. 11:14 - 11:15
3. 11:17 - 11:19
4. 13:10 - 13:10
5. 13:15 - 13:19
Alice = 1
1. 13:17 - 13:19