对列表中的列表去重

 

[[2],[33,4],[2]]


 

 

TypeError  unhashable type:'list'

 

 

l=[[2],[33,4],[2]]

u_l=[]

[u_l.append(i) for i in l if i not in u_l]



 

 

 

 Get unique values from a list in python - Stack Overflow https://stackoverflow.com/questions/12897374/get-unique-values-from-a-list-in-python

 

l = [e for i, e in enumerate(l) if l.index(e) == i]


 

 

 


 

 

 

 

 

 


posted @ 2018-05-19 14:40  papering  阅读(392)  评论(0编辑  收藏  举报