2018年2月21日 星期三

Python 3 教程

http://www.runoob.com/python3/python3-tutorial.html

http://glophy.com/index.php/2014-01-26-07-09-30

Python去除列表list重複或相似元素的方法

http://www.sijitao.net/2441.html

def remove_similar ( lists , similarity = 0.9 ): 
    i = 0 
    l = len ( lists ) while i < l : 
        j = i + 1 while j < l : 
            seq = difflib . SequenceMatcher ( None , lists [ i ], lists [ j ]) 
            ratio =
    
        seq . ratio () if ratio >= similarity : del lists [ j ] 
                l = l - 1 else : 
                j += 1 
        i += 1 
        return lists