completely new here, I tried looking up my problem but couldn't find anything quite similar!
I'm trying to set up a dataframe that contains the data for a schedule and its activity types. For example, if it's '1' it's a normal activity, and if it's '2' it's canceled, and compare that dataframe to another one to see if there is a date between the start/end date in the first dataframe, and if so, modify it so that it becomes 3 rows instead of 1, having the first Start/End date row until that said holiday, the holiday date row, and then the Start/End date continuing after the holiday.
I have no problem creating a single data frame, however my problem arises when I want to compare another series/data frame and potentially add rows that could be between said StartDate and EndDate.
Example Schedule dataframe
Start Date | End Date | Activity Type |
---|---|---|
2021-01-01 | 2021-12-31 | 1 |
When compared to the other dataframe
Holiday Start Date | Holiday End Date |
---|---|
2021-02-14 | 2021-02-14 |
2021-07-04 | 2021-07-05 |
Ending up like this:
Start Date | End Date | Activity Type |
---|---|---|
2021-01-01 | 2021-02-13 | 1 |
2021-02-14 | 2021-02-14 | 2 |
2021-02-15 | 2021-07-03 | 1 |
2021-07-04 | 2021-07-04 | 2 |
2021-07-05 | 2021-12-31 | 1 |
Any help is appreciated!
Thanks, S.