[Numpy-discussion] range in numpy where

Ross Williamson rw247@astro.columbia....
Thu Jan 22 18:28:37 CST 2009


Hi All

I want to get out the index of values in an array. Normally WHERE  
works fine for one conditional statement but it does not work for two  
- i.e.

a = array([0,1,2,3,4,5,6,7,8,9])

ind, = where(a > 5)

Works fine but if I wanted:

ind = where((a > 5) and (a<8))

Then it bugs out with the following message:

"The truth value of an array with more than one message is ambiguous"

Any ideas?

Cheers

Ross


More information about the Numpy-discussion mailing list