The solution as it is presented here:
This does not manage to properly identify the time stamp ranges.
The reason is that using np.argmin([True] * len(time_stamps)) will return 0 which is not correct. It should return len(time_stamps).
This could be a working solution: next((i for i, v in enumerate(lst) if not v), len(lst)) where lst = the np.less(...)