0

I have a np 3D array of values like:

a = np.array([[[ 1,  2,  3],
         [ 0,  5,  6]],

        [[ 7,  0,  9],
        [10, 0, 12]],

        [[ 0, 13, 0],
        [-1, 15, 0]]])

you can say that this array consists of 3 frames each frame is (2*3) array

I want to determine the position of zero values of each line in this array:

my expectation is a 2D array like :

OUT=[[2, 1, 2]
    ,[0, 1, 2]]

where this array determine the frame at which the value is zero in each line along the frame number axis.

could you please help me to do this? np.where works well but only for 2D arrays but here my array is 3D

ibrahim
  • 51
  • 8
  • [Why β€œCan someone help me?” is not an actual question?](https://meta.stackoverflow.com/questions/284236/why-is-can-someone-help-me-not-an-actual-question) – wwii Jun 06 '19 at 02:52
  • @wwii Actually in that case the question is narrow enough... (that it has a duplicate target) – user202729 Jun 06 '19 at 03:45

0 Answers0