I would like to slice a numpy array to obtain the i-th index in the last dimension. For a 3D array, this would be:
slice = myarray[:,:,i]
B
There is ... or Ellipsis, which does exactly this:
...
Ellipsis
slice = myarray[..., i]
Ellipsis is the python object, if you should want to use it outside the square bracket notation.