On Mon, Oct 6, 2008 at 1:59 PM, Robert Kern <[EMAIL PROTECTED]> wrote:
> On Mon, Oct 6, 2008 at 14:32, John <[EMAIL PROTECTED]> wrote:
> > hi,
> >
> > why does the ValueError appear below, and how can i make that 2 > expression work when a is an array?
>
> (2 arguments to actual boolean True or Fa
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 expression work when a is an array?
>>> (a > 2) & (a < 5)
array([
On Mon, Oct 6, 2008 at 14:32, John <[EMAIL PROTECTED]> wrote:
> hi,
>
> why does the ValueError appear below, and how can i make that 2 expression work when a is an array?
(2http://projects.scipy.org/mailman/listinfo/numpy-discussion
-discussion@scipy.org
נושא: [Numpy-discussion] multi-comparison expressions
hi,
why does the ValueError appear below, and how can i make that 2>> from numpy import reshape,arange
>>> a=reshape(arange(9),(3,3))
>>> a
array([[0, 1, 2],
[3, 4, 5],
[6, 7, 8]])
>
hi,
why does the ValueError appear below, and how can i make that 2>> from numpy import reshape,arange
>>> a=reshape(arange(9),(3,3))
>>> a
array([[0, 1, 2],
[3, 4, 5],
[6, 7, 8]])
>>> 2>> a<5
array([[ True, True, True],
[ True, True, False],
[False, False, False]], d