Re: [Numpy-discussion] multi-comparison expressions

2008-10-06 Thread Charles R Harris
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

Re: [Numpy-discussion] multi-comparison expressions

2008-10-06 Thread Christopher Barker
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([

Re: [Numpy-discussion] multi-comparison expressions

2008-10-06 Thread Robert Kern
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

Re: [Numpy-discussion] multi-comparison expressions

2008-10-06 Thread Nadav Horesh
-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]]) >

[Numpy-discussion] multi-comparison expressions

2008-10-06 Thread John
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