2

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)
2
  • Is it a numpy.array? Commented May 12, 2017 at 18:23
  • Python has lists, not arrays. NumPy is the most common array provider. What do you have? Commented May 12, 2017 at 18:26

1 Answer 1

2

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)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.

Ask question

Explore related questions

See similar questions with these tags.