I am trying to aggregate data based on the day of each month that it occurs. I want to group all of the Jan 1st together from 2010-2019, and then the Jan 2nd, etc...
I generate a list of dates from 2010-2019.
def list_dates(start, end):
num_days = (end - start).days
return [start + dt.timedelta(days=x) for x in range(num_days)]
start_date = dt.date(2010, 1, 1)
end_date = dt.date(2019, 12, 31)
date_list = list_dates(start_date, end_date)
Now, I am having trouble subdividing this list into 366 separate lists that only include similar days. Would be it be best to use some sort of dt.timedelta()
operation?