say I have a numpy list of lists:
import numpy as np
ab=np.array([[1,2,3,4,5],[2,3,4,5,6],[3,4,5,3,6]])
Now say I want to have the submatrix the first two rows and column 1 and 3, I would do
print(ab[0:2,[1,3]])
Now if I want row 0 and 2 and columns 1 and 3, I would try:
print(ab[np.array([0,2]),np.array([1,3])])
But then I get :
[3 6]
This is entries wise seeking and not rows and columns wise submatrixing.
How do you do it?