I have a list of events that occur at exact mS intervals that span several days. I want to group all the events occurring in the "per-n-minutes" slot (maybe twenty events, there can be no events). I have a datetime.datetime element for each event, so I can get datetime.datetime.minute without any problems.
My list of events is sorted by time, at least the first, last last. The list is completed during the time period that I am working on.
The idea is that I can change the list: -
[[a],[b],[c],[d],[e],[f],[g],[h],[i]...]
where a, b, c, occur between mins 0 and 29, d, e, f, g occur between mins 30 and 59, nothing between 0 and 29 (next hour), h, i between 30 and 59 ...
to the new list: -
[[[a],[b],[c]],[[d],[e],[f],[g]],[],[[h],[i]]...]
I am not sure how to create an iterator that will go through two time intervals until the end of the list of time series. All I can think of when using xrange stops after it finishes, so I wondered if there was a way to use `while 'to do the slicing?
I will also use a shorter time interval, maybe 5 minutes, I used 30 minutes as a shorter demo example.
(for context, I am creating a graph based on the geometers of recent earthquakes in New Zealand and I want to show all the earthquakes that occur in a short period of time in one step to speed up the repetition) / p>