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)
实例代码:
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)