我有这样一个.txt文件:
ancient 0.4882
detained 5.5512
neighboring 2.9644
scores 0.5951
eggs 0.918
excesses 3.0974
proceedings 0.7446
menem 1.7971
我想通过比较前三个单词在一个列表中的值和另一个列表中剩余的单词来显示它们。你知道吗
也就是说,这个例子的输出应该是:
[detained, excesses, neighboring]
&;[menem, eggs, proceedings, scores, ancient]
怎么做?你知道吗
编辑:
我忘了提一件事:我只想考虑那些值大于0.5的词怎么做?你知道吗
使用csv的答案比我的更简洁,但这里有另一种方法。你知道吗
相关问题 更多 >
编程相关推荐