Hello,

I am trying to solve a simple problem that becomes complex if I try to 
avoid looping.

Let's say I have a 1D array, x,  where x[i] <= x[i+1]

Given a certain value delta, I would like to get a subset of x, named y, 
where (y[i+1] - y[i]) >= delta

In a non-optimized and trivial way, the operation I would like to do is:

y=[x[0]]
for value in x:
    if (y[-1] -value) < delta:
       y.append(value)
y=numpy.array(y)

Any hint?

Best regards,

Armando

_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to