-1
我需要比較兩種列表如下。Python比較元組列表和聚集詞列表
詞語的列表以及它們的頻率列表的
list_1=[('psicomotricita',6), ('psicomotorio',5) , ('psicomotorie',6),('psicomotore', 7),
('bella',1), ('biella',7), ('bello',3),('zorro',4)]
列表,其中每一個子列表是通過它們的相似性的單詞的聚類。
list_2=[['psicomotricità', 'psicomotorio','psicomotorie','psicomotore']
['bella', 'biella', 'bello']
['zorro']]
所以,我需要循環的list_2的每個子列表,以回升,在與最大頻率LIST_1比較字。
結果應該是:
final_list['psicomotore','biella','zorro']
有沒有人誰可以幫我?謝謝!
可能重複[按照相似性和頻率對字符串列表進行聚類](http:/ /stackoverflow.com/questions/42556184/clustering-a-list-of-string-by-their-similarity-and-frequence) –
嘿@ Anony-Mousse,你如何看待下面的答案? – CosimoCD