Here I have a matrix a=np.array([[1,2,3,4,5],[6,7,8,9,10],[11,12,13,14,15]])
I want to select all rows, but the column I want to select is from the first to the third one.
It should be [[1,2,3],[6,7,8],[11,12,13]]
However, I have ever tried a[:,[0,2]]
, but it shows
array([[ 1, 3],
[ 6, 8],
[11, 13]])
It seems not the correct, so I tried another one a[:][0:2], it still is a wrong result.
So I want to ask if there are any function or method can fix the problem?