fork download
  1. #!/usr/bin/env python
  2. # coding: utf-8
  3.  
  4. import numpy
  5.  
  6. A = numpy.array([239, 1678, 2678, 4430, 199])
  7. B = numpy.array([4126.77552299, 984.39685939, 237.92397237, 497.72447701, 3377.17916825])
  8.  
  9. result = numpy.empty_like(B)
  10. result[numpy.argsort(A)] = numpy.sort(B)
  11.  
  12. print repr(result)
Success #stdin #stdout 0.04s 25296KB
stdin
Standard input is empty
stdout
array([  497.72447701,   984.39685939,  3377.17916825,  4126.77552299,
         237.92397237])