I have a numpy array a
of shape (8193, 10, 15, 2, 2)
. Now, i want to select 2 elements along the 2nd and one along the 5th dimension, starting to count dimensions at 1. However, the slice operations seems to rotate the dimension somehow, and a[:,[0,3],:,:,0].shape
results in (2, 8193, 15, 2)
, i.e. one of the later dimensions ends up being the first (?!). Consecutive indexing a[:,[0,3]][:,:,:,:,0].shape
yields (8193, 2, 15, 2)
, i.e. the expected result. Also a[:,[0,3],0,:,:].shape
yields (8193, 2, 2, 2)
, thus, works as expected. Anyone knows what's going on?