I have:
import numpy as np a = np.array([0, 1, 2], [4, 5, 6]) and now how can I transpose this matrix to get
a = [[0, 4], [1, 5], [2, 6]] ?
Transposing an array into numpy is done like this:
import numpy as np a = np.array([[0, 1, 2], [4, 5, 6]]) a = a.transpose() print(a) Result:
[[0 4] [1 5] [2 6]] aT transposed view returns. - jfs import numpy as np a = np.array([0, 1, 2], [4, 5, 6]) a = aT Source: https://ru.stackoverflow.com/questions/500957/
All Articles
array([[1], [2], [3]]). - insolor