<p>我有一个不同国家2013年人口类型序列的对象,其中国家是指数</p>
<p>输入示例:</p>
<pre><code>Country Name Population in 2013
Aruba 103159.0
Afghanistan 32269589.0
Angola 26015780.0
... ...
</code></pre>
<p>现在我想随机挑选一个国家及其人口。我是这样做的</p>
<pre><code>countr = set(country.name for country in pycountry.countries)
listofcountr=list(countr)
randcountry=random.choice(listofcountr)
</code></pre>
<p>现在我想找到5个国家,它们的人口和我随机找到的这个国家的人口最接近。在绝对值的意义上最接近。我怎样才能做到这一点</p>