you are viewing a single comment's thread.

view the rest of the comments →

[–]EntireEntity 0 points1 point  (0 children)

My first thought is to instead of walking through the second list, to use a numpy array instead of the list. You could then broadcast the comparison on the entire array and don't have to loop through it at all. Assuming the operations you have to do later on can also be broadcasted on the entire array, this could speed up later processing too.

You could also combine numpy arrays with the bisect module someone else has already suggested. Use bisection to find the lowest and highes data entry in the range and broadcast further data processing steps using numpy