In Python Numpy, the array.argsort returns the indices that would sort an array.
In F# we can do that as depicted below.
Let there is an array
To get argsort as like above
1 2 3 4
Array.mapi helps to return a tuple with first element as array value and second element as index position. This array has been sorted by the first element. Finally Array.map helps to return second element of the tuple. The result is