m2D = measurement[np.arange(N) + np.arange(len(measurement) - N + 1)[:, (None)]
    ]
m2D
np.nonzero(np.all((lower_bound < m2D) & (higher_bound > m2D), axis=1))[0][0]
Find range of length N in a numpy array where some condition is satisfied