Categories
How to remove duplicates in the list of dictionaries?
Let's say we have a list of dictionaries like this:
els = [{'check': 22}, {'check': 22}, {'check2': 33}]
Answer the question
In order to leave comments, you need to log in
unique_els = [] for dict_item in els: if dict_item not in unique_els: unique_els.append(dict_item)
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question