First Python list index greater than x?
next(x[0] for x in enumerate(L) if x[1] > 0.7)
>>> alist= [0.5, 0.3, 0.9, 0.8]
>>> [ n for n,i in enumerate(alist) if i>0.7 ][0]
2
if list is sorted then bisect.bisect_left(alist, value)
is faster for a large list than next(i for i, x in enumerate(alist) if x >= value)
.