2016-08-03 110 views

回答

0

用途:

x = y[x] 

例子:

>>> import numpy as np 
>>> x = np.array([1,2,3,4,0,1,2,3]) 
>>> y = np.array([3,4,0,1,2]) 
>>> y[x] 
array([4, 0, 1, 2, 3, 4, 0, 1]) 

或者,向人們展示分配:

>>> x = y[x] 
>>> x 
array([4, 0, 1, 2, 3, 4, 0, 1]) 
相關問題