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

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -