check for inequalities on a list
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.
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
participants (2)
-
Alan G Isaac
-
gerardob