2016-09-29 IDに対応する値のベクトル ids = np.array([0,0,0,1,1,2]) x=np.array([5,10,15]) x[ids] Out[0]: array([ 5, 5, 10, 10, 15])