Re: [Numpy-discussion] how to assign to a "sub set" of an array

2007-11-14 Thread Sebastian Haase
On Nov 14, 2007 5:59 PM, Timothy Hochberg <[EMAIL PROTECTED]> wrote: > > > > On Nov 14, 2007 9:08 AM, Sebastian Haase <[EMAIL PROTECTED]> wrote: > > Hi, > > First here is some test I ran, where I think the last command shows a bug: > > > > >>> a = N.arange(4); a.shape=2,2; a > > [[0 1] > > [2 3]]

Re: [Numpy-discussion] how to assign to a "sub set" of an array

2007-11-14 Thread Timothy Hochberg
On Nov 14, 2007 9:08 AM, Sebastian Haase <[EMAIL PROTECTED]> wrote: > Hi, > First here is some test I ran, where I think the last command shows a bug: > > >>> a = N.arange(4); a.shape=2,2; a > [[0 1] > [2 3]] > >>> aa = N.array((a,a,a)); aa > [[[0 1] > [2 3]] > > [[0 1] > [2 3]] > > [[0 1] >

[Numpy-discussion] how to assign to a "sub set" of an array

2007-11-14 Thread Sebastian Haase
Hi, First here is some test I ran, where I think the last command shows a bug: >>> a = N.arange(4); a.shape=2,2; a [[0 1] [2 3]] >>> aa = N.array((a,a,a)); aa [[[0 1] [2 3]] [[0 1] [2 3]] [[0 1] [2 3]]] >>> N.nonzero(a==0) ([0], [0]) >>> aa[N.nonzero(a==0)] = 5,5; aa [[[5 544434