0

My question can be a duplicate but I can't find the answer.

I have a numpy array:

In[1]: b

Out[1]:
array([[ 0,  1,  2,  3],
       [ 4,  5,  6,  7],
       [ 8,  9, 10, 11],
       [12, 13, 14, 15]])

And I want to select some features from this array.

For example:

In [1]: select(b,0,3)
Out [1]:
array([[ 0, 3],
           [ 4, 7],
           [ 8, 11],
           [ 12, 15]])


In[2]: select(b,1,3)

out [2]:
array([[ 1, 3],
           [ 5, 7],
           [ 9, 11],
           [13, 15]])
farhawa
  • 10,120
  • 16
  • 49
  • 91
  • 5
    You want this: http://stackoverflow.com/questions/8386675/extracting-specific-columns-in-numpy-array – Alex Riley Aug 24 '15 at 12:42
  • 1
    I am not looking for someone to write my code!! I am looking for some "standard" method in numpy package that do what I am looking for!! please don't throw useless comments – farhawa Aug 24 '15 at 12:43
  • thanks @ajcr, my comment was for an other user who delete his comment I think – farhawa Aug 24 '15 at 12:44

0 Answers0