Matrix Transpose does not work properly

asked 2012-12-13 08:32:38 -0500

Himanshu gravatar image

Hi,

I am using M.t() transpose function, but the output is incorrect:

Input matrix M:

 1    -2     1     0     0     0     0     0
 0     1    -2     1     0     0     0     0
 0     0     1    -2     1     0     0     0
 0     0     0     1    -2     1     0     0
 0     0     0     0     1    -2     1     0
 0     0     0     0     0     1    -2     1

After transposing (M.t()), I am getting following output which is wrong:

 1    -2     0     1     0     0
 1     0    -2     1     1    -2
 0     0     0     0     1     0
 0     0     0     0     0     0
 0     0     0     0     0     0
 0     0     0     0     0     0
 0     0     0     0     0     0
 0     0     0     0     0     0

Can anyone tell me why is this happening?

Thanks.

edit retag flag offensive close merge delete