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.
So I have this 24403x90x3 array in Python. How can I print the first row, but only get all 90, but only choose the first depth out of three.
In Matlab it would just be:
A(1, :, 1)
numpy.array
Python allows for almost the same syntax. However, in Python indexing starts at zero, and, you use brackets instead of parentheses, giving you:
A[0,:,0]
(where I have assumed A to be a numpy.array)
A
Add a comment
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
numpy.array?