Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python remove duplicates from list of dict

# set the dict to a tuple for hashability, then use {} for set literal and retrn each item to dict. 
[dict(t) for t in {tuple(d.items()) for d in l}]
# using two maps()
list(map(lambda t: dict(t), set(list(map(lambda d: tuple(d.items()), l)))))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #remove #duplicates #list #dict
ADD COMMENT
Topic
Name
9+5 =