transpose matriks dalam python numpy
np.transpose(x)
array([[0, 2],
[1, 3]])
Energetic Eagle
np.transpose(x)
array([[0, 2],
[1, 3]])
>>> import numpy as np
>>> M = np.array([[1,2,3],[4,5,6],[7,8,9]])
>>> M
array([[1, 2, 3],
[4, 5, 6],
[7, 8, 9]])
>>> M.T
array([[1, 4, 7],
[2, 5, 8],
[3, 6, 9]])
arr = list(list(x) for x in zip(*arr))