您可以使用一组:
b_set = set(map(tuple,a)) #need to convert the inner lists to tuples so they are hashableb = map(list,b_set) #Now convert tuples back into lists (maybe unnecessary?)
b_set = set(tuple(x) for x in a)b = [ list(x) for x in b_set ]
最后,如果顺序很重要,则可以始终对b进行排序:
b.sort(key = lambda x: a.index(x) )
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)