Basically what I have is this:
secondData = [["8:33:00", 5], ["8:33:01", 3], ...] # and so forth
minuteData = [["8:33:00", 6], ["8:34:00", 5], ...] # and so forth
Now pretend like the time is an actual datetime object
What I want to do is find the most efficient method for iterating through the minute data and getting all the contained second data for that minute. e.g. if I have “8:34:00” I want “8:34.00″..”8:34:59”. Is there an easy way to make a list filter for this or something?
I should note that the lists are arranged in order of time, however there might be missing second data. I might only have 33 data points for the minute 9:58 for example.
Use bisect.
This will give you the slice of
secondDatafor the half-open interval [“8:33:00”..”8:34:00″).