参考:Equivalent of Numpy.argsort() in basic python? - Stack Overflow
通过 enumerate 实现
[i for i,v in sorted(enumerate(['Vincent', 'Alex', 'Bill', 'Matthew']), key=lambda x:x[1])] output: [1, 2, 3, 0]
参考:Equivalent of Numpy.argsort() in basic python? - Stack Overflow
通过 enumerate 实现
[i for i,v in sorted(enumerate(['Vincent', 'Alex', 'Bill', 'Matthew']), key=lambda x:x[1])] output: [1, 2, 3, 0]