I would like to dynamically slice a numpy array along a specific axis. Given this:
axis = 2 start = 5 end = 10
I want to achieve the same r
As it was not mentioned clearly enough (and i was looking for it too):
an equivalent to:
a = my_array[:, :, :, 8] b = my_array[:, :, :, 2:7]
is:
a = my_array.take(indices=8, axis=3) b = my_array.take(indices=range(2, 7), axis=3)