I have a numpy array:
a = np.array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 2, 2, 2, 2])
and I'm using argsort function to short this array
a.argsort()
the result that I got was
array([ 0, 10, 8, 7, 6, 9, 4, 3, 2, 1, 5, 18, 16, 17, 19, 11, 12, 13, 14, 15], dtype=int64)
While the expected result should be:
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 16, 17, 18, 19, 11, 12, 13, 14, 15], dtype=int64)
I have tried also to reduce the array to be less than 16 members and it was working well. Is there something wrong with argsort function?