fork(1) download
  1. import numpy as np
  2.  
  3. A = np.array([[0.25, 0.25], [0.25, 0.75], [0.75, 0.25], [0.75, 0.75], [0.8, 0.9]])
  4. B = np.array([0, 1, 2, 4, 0, 3, 3])
  5. C = A[B, :]
  6. print(C)
Success #stdin #stdout 0.08s 92224KB
stdin
Standard input is empty
stdout
[[ 0.25  0.25]
 [ 0.25  0.75]
 [ 0.75  0.25]
 [ 0.8   0.9 ]
 [ 0.25  0.25]
 [ 0.75  0.75]
 [ 0.75  0.75]]