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)
Goku
  • 23
  • 7
  • 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 – juanpa.arrivillaga May 20 '21 at 11:07
  • What do you intend by the nesting of lists in the array creation? Does `print(zone)` look the same? – hpaulj May 20 '21 at 15:11

1 Answers1

0

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

Tabaraei
  • 445
  • 2
  • 7
  • 18