I am trying to select a subset of a multidimensional array using another array, so for example, if I have:
a=np.linspace(1,30,30)
a=a.reshape(5,3,2)
I would like to take the subset [:,0,1], which I can do by saying
a_subset=a[:,0,1]
but, is there any way to define an array/list specifying that subset and then subtract it? The idea is to do something like:
b=[:,0,1]
a_subset=a[b]
which does not work as ":" is not accepted as item ("SyntaxError: invalid syntax")