May 10, 2010
9: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