Intuition of numpy slicing - Course 4, week 2, Residual_Networks, UNQ_C1 evaluation part

I’ll appreciate it if someone could help me understand the NumPy slicing happening in the highlighted part of the following image. Thanks

Hi mdfarooq0815,

The tuple ‘(0,-1)’ selects the first and the last submatrix from the second dimension of A3 to be printed out. You can see this if you try ‘:’ instead (printing out all submatrices), ‘(0,1)’ which prints out the first two submatrices, and so on. So the tuple functions as a selector of elements.

1 Like