Selecting specific rows and columns from NumPy array
As Toan suggests, a simple hack would be to just select the rows first, and then select the columns over that. >>> a[[0,1,3], :] # Returns the rows you want array([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [12, 13, 14, 15]]) >>> a[[0,1,3], :][:, [0,2]] # Selects the columns you want as … Read more