First convert your matrix to Numpy array and then use transpose. Check the following example.
>>> import numpy as no>>> a=no.array([[1,2,3,4],[5,6,7,8],[9,10,11,12]])>>> aarray([[ 1, 2, 3, 4], [ 5, 6, 7, 8], [ 9, 10, 11, 12]])>>> a.Tarray([[ 1, 5, 9], [ 2, 6, 10], [ 3, 7, 11], [ 4, 8, 12]])>>>
>>> import numpy as no
>>> a=no.array([[1,2,3,4],[5,6,7,8],[9,10,11,12]])
>>> a
array([[ 1, 2, 3, 4],
[ 5, 6, 7, 8],
[ 9, 10, 11, 12]])
>>> a.T
array([[ 1, 5, 9],
[ 2, 6, 10],
[ 3, 7, 11],
[ 4, 8, 12]])
>>>