I have a list of np.datetime64
dates in Python:
['2016-12-01T02:00:00.000000000', '2016-12-01T04:00:00.000000000',
'2016-12-01T06:00:00.000000000', '2016-12-01T08:00:00.000000000',
'2016-12-01T10:00:00.000000000', '2016-12-01T12:00:00.000000000',
'2016-12-01T14:00:00.000000000', '2016-12-01T16:00:00.000000000',
'2016-12-01T18:00:00.000000000', '2016-12-01T20:00:00.000000000',
'2016-12-01T22:00:00.000000000', '2016-12-02T00:00:00.000000000',
'2016-12-02T02:00:00.000000000', '2016-12-02T04:00:00.000000000',
'2016-12-02T06:00:00.000000000', '2016-12-02T08:00:00.000000000',
'2016-12-02T10:00:00.000000000', '2016-12-02T12:00:00.000000000',
'2016-12-02T14:00:00.000000000', '2016-12-02T16:00:00.000000000',
'2016-12-02T18:00:00.000000000', '2016-12-02T20:00:00.000000000',
'2016-12-02T22:00:00.000000000', '2016-12-03T00:00:00.000000000',
'2016-12-03T02:00:00.000000000', '2016-12-03T04:00:00.000000000',
'2016-12-03T06:00:00.000000000', '2016-12-03T08:00:00.000000000',
'2016-12-03T10:00:00.000000000', '2016-12-03T12:00:00.000000000',
'2016-12-03T14:00:00.000000000', '2016-12-03T16:00:00.000000000',
'2016-12-03T18:00:00.000000000', '2016-12-03T20:00:00.000000000',
'2016-12-03T22:00:00.000000000']
and I wish to loop over each calendar day within the list. I have tried to extract each unique date from the list (i.e. finding the min and max date and creating a list of dates between these) but this isn't ideal for what I want to do.
My desired outcome would be to have code that allows me to loop over each date/calendar day found in the list and obtain the datetimes corresponding to this date:
for each_date in date_list:
***get all datetimes corresponding to each_date***
(loop would occur 3 times in this example)
NOTE:
1) Solutions that iterate over every [n:n+24] or whatever will not work as not every day will have the same number of time steps.