Hi I am trying to slice 2 columns from a 2D numpy array but it seems that I can't get it without using a loop.
What am i missing? I am trying to get [3 7 11] and [4 8 12].
import numpy as np
a=np.array([1,2,3,4,5,6,7,8,9,10,11,12])
a=np.reshape(a,(3,4))
print a[:,2] #vgives me [ 3 7 11]
The only way I can do it seems to be with a loop
for i in range(2,4):
print a[:,i]
How can I do that with pure Numpy slicing?