Re: [Numpy-discussion] Accumulate values that are below threshold

2009-01-08 Thread Bevan Jenkins
Stéfan van der Walt sun.ac.za> writes: > > Hi Bevan > > Since the number of output elements are unknown, I don't think you can > implement this efficiently using arrays. If your dataset isn't too > large, a for-loop should do the trick. Otherwise, you may have to run > your code through Cytho

Re: [Numpy-discussion] Accumulate values that are below threshold

2009-01-07 Thread Stéfan van der Walt
Hi Bevan Since the number of output elements are unknown, I don't think you can implement this efficiently using arrays. If your dataset isn't too large, a for-loop should do the trick. Otherwise, you may have to run your code through Cython, which optimises for-loops around Python lists. thres

[Numpy-discussion] Accumulate values that are below threshold

2009-01-07 Thread Bevan Jenkins
Hello, Sometimes the hardest part of a problem is articulating it. Hopefully I can describe what I am trying to do - at least enough to get some help. I am trying to compare values to a threshold and when the values are lower than the threshold they are added to the value in my set until the thr