Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python argsort a list

a=list((1, 2, 3, -20))
sorted(range(len(a)), key=a.__getitem__)

output:
[3, 0, 1, 2]
 
PREVIOUS NEXT
Tagged: #python #argsort #list
ADD COMMENT
Topic
Name
1+7 =