排序我有一個包含線如下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