2016-03-04 77 views

回答

4

一旦你实际使用numpy.array S,它的所有作品:

import numpy as np 

selections = np.array([True, False, True]) 
data = np.array([[ 1, 2, 3 ], 
     [ 4, 5, 6 ]]) 

>>> data[:, selections] 
array([[1, 3], 
     [4, 6]])