Re: [Numpy-discussion] finding range of values below threshold in sorted array

2009-08-14 Thread Emmanuelle Gouillart
Hi, ind = np.searchsorted(A, b) values = A[:ind] Cheers, Emmanuelle On Fri, Aug 14, 2009 at 02:27:23PM +0200, Mark Bakker wrote: >Hello List, >I am trying to find a quick way to do the following: >I have a *sorted* array of real numbers, say array A, sorted in ascending >order

[Numpy-discussion] finding range of values below threshold in sorted array

2009-08-14 Thread Mark Bakker
Hello List, I am trying to find a quick way to do the following: I have a *sorted* array of real numbers, say array A, sorted in ascending order (but easy to store descending if that would help) I want to find all numbers below a certain value, say b Sure, I can do A < b and I will get back a