John wrote: > hi, > > why does the ValueError appear below, because python short circuits this expression, and numpy can't overwrite that -- the same reason a and b doesn't work for a and b arrays.
> and how can i make that 2<a<5 > expression work when a is an array? >>> (a > 2) & (a < 5) array([[False, False, False], [ True, True, False], [False, False, False]], dtype=bool) & is the bitwise-and, which is overridden by numpy, and works like and for boolean data. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion