0

I've a 3 dimensional numpy array. When I try to print it's shape, I get (4, 1, 2). Now I'm struggling to figure out which value corresponds to row, column and depth.

Code:

import numpy as np

zone = np.array([[[221,529]],
               [[156,850]],
               [[374,858]],
               [[452,537]]])

print(zone.shape)
2
  • 2
    "row, column and depth" are not concepts that apply. Those are arbitrary designations that you give the array. The array just knows it has dimension (axis) 0, 1, and 2. You can think of them any way you'd like Commented May 20, 2021 at 11:07
  • What do you intend by the nesting of lists in the array creation? Does print(zone) look the same? Commented May 20, 2021 at 15:11

1 Answer 1

0

.shape returns dimensions respectively. So it means you have 4 rows, 1 column, and depth of 2.

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

1 Comment

are you sure with a given example?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.