-1

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.

0

1 Answer 1

0

Use Transpose (.T)

ar = np.array([[1,2],[3,4],[5,6]])
ar.T
Sign up to request clarification or add additional context in comments.

1 Comment

.T is transpose, not transformation.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.