[Numpy-discussion] Elementary Array Switching
geometrian at gmail.com
Fri Jun 12 14:21:02 EDT 2009
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
But it doesn't work as expected.
I'm definitely not very good at NumPy, so I get the feeling it's something
silly I'm doing. What should that code look like?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion