check for inequalities on a list

10 May
2010
10 May
'10
1:42 p.m.
I have three lists of floats of equal lenght: upper_bound, lower_bound and x.
I would like to check whether lower_bound[i]<= x[i] <= upper_bound[i] for all i in range(len(x))
Which is the best way to do this?
Thanks.
--
View this message in context: http://old.nabble.com/check-for-inequalities-on-a-list-tp28517353p28517353.h...
Sent from the Numpy-discussion mailing list archive at Nabble.com.

10 May
10 May
1:47 p.m.
On 5/10/2010 5:42 PM, gerardob wrote:
I would like to check whether lower_bound[i]<= x[i]<= upper_bound[i] for all i in range(len(x))
import numpy as np l, m, u = np.arange(12).reshape((3,4)) (l <= m) & (m <= u)
array([ True, True, True, True], dtype=bool)
l[3]=9 (l <= m) & (m <= u)
array([ True, True, True, False], dtype=bool)
hth, Alan Isaac
4893
Age (days ago)
4893
Last active (days ago)
1 comments
2 participants
participants (2)
-
Alan G Isaac
-
gerardob