Find first threshold crossing in numpy array
In principle you can use numpy.argmax for this. The only problem is that if no value is above the threshold, the maximum is False, so it returns 0 as the index of the maximum. We therefore need to subtract 1 for those cases:

above_threshold = data &gt; thresh
react_tms = np.argmax(above_threshold, axis=1)
react_tms = react_tms - (~np.any(data &gt; thresh, axis=1)).astype(float)
print(react_tms)
# array([ -1.,  -1.,  18.,  12.])


Whether or not that is really more readable, I am not sure. It is, however slightly faster than using numpy.where (and probably also faster than a list comprehension): https://stackoverflow.com/q/16243955/4042267

In the end this does not really matter: