I've got a list of datetime objects (key) and number of events that occur at those times(value). We'll call this the time_list.
Let's assume that I also have the following variables (these are also datetime objects):
datetime1 = Jan 1, 2019, 6:30PM
datetime2 = Jan 1, 2019, 8:30PM
What's the most efficient way to determine if there are any entries in the list that are > datetime1 and < datetime2?
I've used a for loop to loop over the items and then break when I find a match, but I'm wondering if there is something more efficient.
Thanks!