As per the title there's a list of available/possible time slots and then there's a list of booked slots. What I need a helping hand with, is a streamlined way, using pandas, to extract booked time slots from the possible ones and rebuild the free time slots data frame. Thank you very much
#1 Possible slots:
>>> df1
start end
0 2023-02-28 08:00:00 2023-02-28 08:30:00
1 2023-02-28 08:30:00 2023-02-28 09:00:00
2 2023-02-28 09:00:00 2023-02-28 09:30:00
3 2023-02-28 09:30:00 2023-02-28 10:00:00
4 2023-02-28 10:00:00 2023-02-28 10:30:00
5 2023-02-28 10:30:00 2023-02-28 11:00:00
6 2023-02-28 11:00:00 2023-02-28 11:30:00
7 2023-02-28 11:30:00 2023-02-28 12:00:00
8 2023-02-28 12:00:00 2023-02-28 12:30:00
9 2023-02-28 12:30:00 2023-02-28 13:00:00
10 2023-02-28 13:00:00 2023-02-28 13:30:00
11 2023-02-28 13:30:00 2023-02-28 14:00:00
12 2023-02-28 14:00:00 2023-02-28 14:30:00
13 2023-02-28 14:30:00 2023-02-28 15:00:00
14 2023-02-28 15:00:00 2023-02-28 15:30:00
15 2023-02-28 15:30:00 2023-02-28 16:00:00
>>>
#2 Booked slots:
>>> df2
start end
0 2023-02-28 08:00:00 2023-02-28 08:15:00
1 2023-02-28 08:15:00 2023-02-28 08:30:00
2 2023-02-28 09:00:00 2023-02-28 09:30:00
3 2023-02-28 12:00:00 2023-02-28 12:45:00
4 2023-02-28 13:15:00 2023-02-28 14:45:00
>>>
#3 The result should be:
>>> df3
start end
0 2023-02-28 08:30:00 2023-02-28 09:00:00
1 2023-02-28 09:30:00 2023-02-28 10:00:00
2 2023-02-28 10:00:00 2023-02-28 10:30:00
3 2023-02-28 10:30:00 2023-02-28 11:00:00
4 2023-02-28 11:00:00 2023-02-28 11:30:00
5 2023-02-28 11:30:00 2023-02-28 12:00:00
6 2023-02-28 12:45:00 2023-02-28 13:00:00
7 2023-02-28 13:00:00 2023-02-28 13:15:00
8 2023-02-28 14:45:00 2023-02-28 15:00:00
9 2023-02-28 15:00:00 2023-02-28 15:30:00
10 2023-02-28 15:30:00 2023-02-28 16:00:00