Thank you for your answer.
I just came across this problem/solution today, and must say the notation is quite counterintuitive to me, and I’ve been using indexing for slicing/assignment in specific dimensions in Numpy/MATLAB for years.
BTW, I was trying to do something like:
for i in range(N):
    b[:,i,:] = function(b[:,i-1,:])

where b has dimensions such as (5,60,10), so an element b[:,j,:] and also the output of ‘function’ has dimensions (5,1,10). I changed to
for i in range(N):
    b[:,i:i+1,:] = function(b[:,i-1:i,:])

Hope this helps others in the future with the same problem.