2012-12-18 3 views

Répondre

3

Si y contient des indices qui sont valables pour x, puis:

z = x[y] 

>>> import numpy as np 
>>> x = np.arange(100) 
>>> y = np.array([1, 27, 36, 98]) 
>>> x[y] 
array([ 1, 27, 36, 98]) 
+0

Ah bien sûr - J'essayais cela mais je me suis juste rendu compte que mon tableau y avait converti pour flotter quelque part le long de la ligne. – astrofrog

+0

@astrofrog ahh uh - yup - ça ne marcherait pas :) –

Questions connexes