I have below code which make a list of date between start and end date with a frequency of 13 days. I'm not sure how I can make it a list with start and end date on it(as what is shown in my expected output)
Note: I should also added those remaining dates
Python Code
from datetime import datetime, timedelta
import pandas as pd
start_date = '2021-10-01T17:30:00Z'
end_date = '2021-10-30T21:00:00Z'
pd.date_range(start_date, end_date ,freq='13D')
Output:
DatetimeIndex(['2021-10-01 17:30:00+00:00', '2021-10-14 17:30:00+00:00','2021-10-27 17:30:00+00:00'],
Expected output:
[
{
"start_date": "2021-10-01 17:30:00+00:00",
"end_date":"2021-10-14 17:30:00+00:00"
},
{
"start_date": "2021-10-14 17:30:00+00:00",
"end_date":"2021-10-27 17:30:00+00:00"
},
{
"start_date": "2021-10-27 17:30:00+00:00",
"end_date":"2021-10-30 17:30:00+00:00"
}
]