I am trying to simply sort an array or a list using numpy.argsort()
. For some reason, it is giving me results in random order:
import numpy
unsorted_list = [1.19021287, 1.19021287, 1.15190644, 1.12193492, 1.19021287, 1.25190644]
sorted_list = numpy.argsort(unsorted_list)
print sorted_list
array([3, 2, 0, 1, 4, 5])
It should return array([0, 1, 4, 3, 5, 4])