python--数据去重

python 根据需求来进行去重

实例代码:

from functools import reduce
rule_list = [1,2,3,43,2,1]
remove_duplicate_func = lamba x,y : x if y in  else x + [y]
res = reduce(remove_duplicate_func, [[], ] + rule_list)
posted @ 2022-01-20 14:51  酷酷的排球  阅读(168)  评论(0编辑  收藏  举报