Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python
how to use the transpose function in numpy?
 

Index | Next | Previous | View Flat


marlin_rowley at hotmail

May 17, 2008, 1:34 PM


Views: 480
Permalink
how to use the transpose function in numpy?

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

Subject User Time
how to use the transpose function in numpy? marlin_rowley at hotmail May 17, 2008, 1:34 PM
    Re: how to use the transpose function in numpy? robert.kern at gmail May 17, 2008, 3:33 PM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.