I have a numpy array of dimension (a,b,c). And I want to slice it to over c'th dimension. For eg: A numpy array of shape (2,3,4), I want to iterate over 4 arrays of dimension (2,3).
So far I have been doing
for i in range(c):
arr = A[::,i]
But this doesn't compute the right thing. How can I compute this?
range(A.shape[-1])