Re: [Numpy-discussion] views or copy

2009-04-07 Thread josef . pktd
On Mon, Apr 6, 2009 at 11:34 PM, Robert Kern wrote: > On Mon, Apr 6, 2009 at 22:31,   wrote: >> I ran again into a problem where numpy created a view (which I didn't >> realize) and an operation works differently on the view than if it >> were a copy. >> >> I try to construct an example array, whi

Re: [Numpy-discussion] views or copy

2009-04-06 Thread Robert Kern
On Mon, Apr 6, 2009 at 22:31, wrote: > I ran again into a problem where numpy created a view (which I didn't > realize) and an operation works differently on the view than if it > were a copy. > > I try to construct an example array, which, however, is only a view > x,y = np.mgrid[0:3,0:3] >

[Numpy-discussion] views or copy

2009-04-06 Thread josef . pktd
I ran again into a problem where numpy created a view (which I didn't realize) and an operation works differently on the view than if it were a copy. I try to construct an example array, which, however, is only a view >>> x,y = np.mgrid[0:3,0:3] >>> xx = np.vstack((x.flatten(), y.flatten(), np.on