排序我有一个包含线如下txt文件(第一场是关键字,所述第二字段是关键字的频率,而第三字段相关文本):线通过使用python
anorexia nervosa 1 在专利网看到一
glaucoma 10 want to suck out my eyeballs and have them replaced with
cancer 691 there is a drug that helps fight cancer called avastin
gene therapy 1 writing a review paper on gene therapy
hormone 35 glad my hormone injections end in a month
depression 259 depression? just made depression cake: recipe here
我想解析像这样(通过这些关键字频率的排序关键字)文件:
cancer 691
depression 259
hormone 35
glaucoma 10
anorexia nervosa 1
gene therapy 1
我检查有关排序和秩序问题的其他问题,但我找不到任何很好的例子。 sort()似乎没有工作。请让我知道好的起点!
发布后请不要修改问题。您获取数据的方式让人分心。发布另一个问题,如果你想优化这个或那样的。 – eudoxos