how to use the transpose function in numpy?

Marlin Rowley marlin_rowley at hotmail.com
Sat May 17 16:34:38 EDT 2008


All:
 
Say I have a series of arrays arranged like so:
 
[[[0,1,2,3]
[4,5,6,7]
[8,9,10,11]
[12,13,14,15]]
 
[[16,17,18,19]
[20,21,22,23]
[24,25,26,27]
[28,29,30,31]]]
 
Now if I do this: transpose((2,0,1)), I get this:
 
[[[0,4,8,12] [16,20,24,28]]
[[1,5,9,13] [17,21,25,29]]
[[2,6,10,14][18,22,26,30]]
[[3,7,11,15][19,23,27,31]]]
 
This is NOT what I want.  I want the new array to be:
 
[0,4,8,12][1,5,9,13]
[2,6,10,14][3,7,11,15]
[16,20,24,28][17,21,25,29]
[18,22,26,30][19,23,27,31]
 
How do I do this?
 
-M
_________________________________________________________________
Make every e-mail and IM count. Join the i’m Initiative from Microsoft.
http://im.live.com/Messenger/IM/Join/Default.aspx?source=EML_WL_ MakeCount
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080517/84841fa3/attachment.html>


More information about the Python-list mailing list