I have two lists.
The list
times
is a list ofdatetimes
from2018-04-10 00:00
to2018-04-10 23:59
.For each item in
times
I have a corresponding label of0
or1
recorded in the listlabels
.
My goal is to get the mean label value (between 0
and 1
) for every minute interval.
times = [Timestamp('2018-04-10 00:00:00.118000'),
Timestamp('2018-04-10 00:00:00.547000'),
Timestamp('2018-04-10 00:00:00.569000'),
Timestamp('2018-04-10 00:00:00.690000'),
.
.
.
Timestamp('2018-04-10 23:59:59.999000') ]
labels = [0,1,1,0,1,0,....1]
where len(times) == len(labels)
For every minute interval between 2018-04-10 00:00
and 2018-04-10 23:59
, the min and max times in the list respectively, I am trying to get two lists:
1) The start time of the minute interval.
2) The mean average label value of all the datetimes in that interval.
In particular I am having trouble with (2).
Note: the times
list is not necessarily chronologically ordered