Created
December 6, 2012 19:57
-
-
Save sputnikus/4227782 to your computer and use it in GitHub Desktop.
Eliminate duplicate dicts from list
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dupla_list = list full of duplicates | |
seen = set() | |
clean_list = [] | |
for item in dupla_list: | |
props = tuple(item.items()) | |
if props not in seen: | |
seen.add(props) | |
clean_list.append(item) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment