[Numpy-discussion] finding range of values below threshold in sorted array
Fri Aug 14 07:27:23 CDT 2009
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 list with a bunch of True-s and then a bunch of
but all I need is the highest index for which A[i] < b, since A is sorted.
Does anybody know a quick way to do this? I need to do it a lot, so the
quicker the better.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion