Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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
Add a comment
.T
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.