python transpose np array

Solutions on MaxInterview for python transpose np array by the best coders in the world

showing results for - "python transpose np array"
Ludovic
22 Jun 2016
1>>> a = np.array([[1, 2], [3, 4]])
2>>> a
3array([[1, 2],
4       [3, 4]])
5>>> a.transpose() #or a.T
6array([[1, 3],
7       [2, 4]])