Very quick question, can’t find an answer with these keywords. What is a better way of doing the following?
t = linspace(0,1000,300)
x0 = generic_function(t)
x1 = x0[x0>0.8]
t1 = t[t>t[len(x0)-len(x1)-1]]
The operation I’m using @t1 strikes me as very un-pythonic and inefficient. Any pointers?
IIUC, you can simply reuse the cut array. For example:
As you’ve already done, you can make a bool array:
and then you can use this to filter both
tandy:No use of
lenor assumptions about monotonicity involved.