I want a pretty way to find the index of the first element of an np.array, that matches some condition. The condition is:
array>constant
This is my solution:
first_index = ((array<constant)*np.arange(len(array))).argmax()+1
Is there a prettier one-line way to do this in numpy or python?