Transposing a matrix using python numpy -
this current matrix:
[[0, 1, 2, 4], [0, 3, 1, 3], [0, 2, 3, 2], [0, 2, 4, 1], [0, 4, 1, 2], [0, 3, 2, 2], [1, 2, 2, 2]]
i want transpose , output:
[[0, 0, 0, 0, 1], [2, 2, 4, 3, 2], [3, 4, 1, 2, 2], [2, 1, 2, 2, 2]]
i used inverse = np.swapaxes(ate,0,7)
not sure axis2
value be. here axis2
7.
i think you're looking np.transpose()
Comments
Post a Comment