Given a sample dataframe:
ID | Start Date | End Date |
---|---|---|
1 | 01-01-2015 | 09-08-2022 |
2 | 01-01-2016 | 05-10-2020 |
How can I create a new column, New Date, that captures the date range between the Start Date and End Date?
ID | Start Date | End Date | New Date |
---|---|---|---|
1 | 01-01-2015 | 09-08-2022 | 01-01-2015 |
1 | 01-01-2015 | 09-08-2022 | 01-02-2015 |
1 | 01-01-2015 | 09-08-2022 | 01-03-2015 |
1 | 01-01-2015 | 09-08-2022 | ... |
1 | 01-01-2015 | 09-08-2022 | 09-08-2022 |
2 | 01-01-2016 | 05-10-2020 | 01-01-2016 |
2 | 01-01-2016 | 05-10-2020 | 01-02-2016 |
2 | 01-01-2016 | 05-10-2020 | 01-03-2016 |
2 | 01-01-2016 | 05-10-2020 | ... |
2 | 01-01-2016 | 05-10-2020 | 05-10-2020 |
I have tried using reindex but my date columns are not in the index currently, is there a way that would allow me to keep my index intact?