Re: [Numpy-discussion] Elementary Array Switching

2009-06-13 Thread Ian Mallett
It seems to be working now--I think my problem is elsewhere. Sorry... ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Elementary Array Switching

2009-06-12 Thread Robert Kern
On Fri, Jun 12, 2009 at 13:21, Ian Mallett wrote: > Hi, > > I have a NumPy array.  The array is 3D, n x n x 3.  I'm trying to flip the > first element of the last dimension with the last.  I tried: > temp = myarray[:,:,0].copy() > myarray[:,:,0] = myarray[:,:,2].copy() > myarray[:,:,2] = temp > del

[Numpy-discussion] Elementary Array Switching

2009-06-12 Thread Ian Mallett
Hi, I have a NumPy array. The array is 3D, n x n x 3. I'm trying to flip the first element of the last dimension with the last. I tried: temp = myarray[:,:,0].copy() myarray[:,:,0] = myarray[:,:,2].copy() myarray[:,:,2] = temp del temp But it doesn't work as expected. I'm definitely not very g