I have a numpy array similar to following structure:
my_array = numpy.array([[1,1,1,2,2,2,3,3,3],
[1,2,3,1,2,3,1,2,3],
[1,1,32,4,15,63,763,23,0],
[1,1,2,3,1,2,3,1,1],
[1,1,1,1,1,1,1,1,1]])
Now I'd like to get subset this array to get only those columns where the value in the 3rd row is < 15.
I can get a boolean list of that as:
list(my_array[2,:]>15)
However I cannot use that boolean list for indexing like:
my_array[:,list(my_array[2,:]>15)]
Probably I have to transform that list to a list of indices and use that to subset the array, but maybe there is an in-built function or straight forward way for selecting the specific columns of the array?