I have a 2d numpy array, matrix_a, shaped 2x20. How do I select columns 5:8 and columns 15:18.
matrix_a = np.array([[1,2,3,4,5...,19,20],
[1,2,3,4,5...,19,20]])
I want to select:
[[5,6,7,15,16,17],
[5,6,7,15,16,17]]
I can select the columns separately using matrix_a[0,5:8], is there a way to select it all at once?
Barring 0-index vs 1-index, in MATLAB, all I would have to do is:
matrix_a(:,[5:8, 15:18])
Is there an analogous, simple command in python?