fork download
  1. import numpy
  2. x = numpy.array([0,1,2,3,4,5,6,7,8,9,10])
  3. indices = list(range(3))+list(range(-4,0))
  4. y = x[indices]
  5. print(y)
Success #stdin #stdout 0.2s 26208KB
stdin
Standard input is empty
stdout
[ 0  1  2  7  8  9 10]