I often work with numpy arrays representing critical times in a time series. I then want to iterate over the ranges and run operations on them. Eg:
rngs = [0, 25, 36, 45, ...]
output = []
for left, right in zip(rngs[:-1], rngs[1:]):
throughput = do_stuff(array[left:right])...
output.append(throughput)
Is there a less awkward way to do this?