Re: [Numpy-discussion] Getting an array's indices when a given condition is true

2008-10-18 Thread Robert Kern
On Sat, Oct 18, 2008 at 22:00, Lane Brooks <[EMAIL PROTECTED]> wrote: > If you want the indexes, check out the np.where command, e.g. > > idx = np.where(dat <= limit) It's worth noting that where() confusingly has two modes of functionality. This particular bit of functionality is also exposed und

Re: [Numpy-discussion] Getting an array's indices when a given condition is true

2008-10-18 Thread Lane Brooks
If you want the indexes, check out the np.where command, e.g. idx = np.where(dat <= limit) If you want the values, use: val = dat[dat <= limit] Lane Michael wrote: Hi list, been playing around with stride_tricks and find it terrifically productive; thankyou to everyone who has worked on th

[Numpy-discussion] Getting an array's indices when a given condition is true

2008-10-18 Thread Michael
Hi list, been playing around with stride_tricks and find it terrifically productive; thankyou to everyone who has worked on this. I need to filter some data, getting the indices of all entries which are less than or equal to 'limit'. How do i best go about that? Can you enumerate an array us