I have a numpy array :
ar = [[1,2],[3,4],[5,6]]
I want to convert it to :
ar = [[1,3,5],[2,4,6]]
I have tried numpy reshape function it did not work. Is there any way to reshape it using numpy reshape method or any other way??
Thank you.
I have a numpy array :
ar = [[1,2],[3,4],[5,6]]
I want to convert it to :
ar = [[1,3,5],[2,4,6]]
I have tried numpy reshape function it did not work. Is there any way to reshape it using numpy reshape method or any other way??
Thank you.
Use Transpose (.T)
ar = np.array([[1,2],[3,4],[5,6]])
ar.T