Remove duplicated lists in list of lists in Python

后端 未结 4 1853
忘了有多久
忘了有多久 2021-01-13 12:10

I\'ve seen some questions here very related but their answer doesn\'t work for me. I have a list of lists where some sublists are repeated but their elements may be disorder

4条回答
  •  感情败类
    2021-01-13 13:06

    What about using mentioned by roippi frozenset this way:

    >>> g = [list(x) for x in set(frozenset(i) for i in [set(i) for i in g])]
    
    [[0, 9, 1], [1, 2, 3], [2, 3, 4]]
    

提交回复
热议问题