Numpy argsort-它在做什么? [英] Numpy argsort - what is it doing?
本文介绍了Numpy argsort-它在做什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为什么numpy给出了这个结果:
Why is numpy giving this result:
x = numpy.array([1.48,1.41,0.0,0.1])
print x.argsort()
>[2 3 1 0]
当我期望它能做到这一点时:
when I'd expect it to do this:
[3 2 0 1]
[3 2 0 1]
很显然,我对该功能缺乏了解.
Clearly my understanding of the function is lacking.
推荐答案
2
is the index of0.0
.3
is the index of0.1
.1
is the index of1.41
.0
is the index of1.48
.
这篇关于Numpy argsort-它在做什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文