Skip to content

Instantly share code, notes, and snippets.

@sputnikus
Created December 6, 2012 19:57
Show Gist options
  • Save sputnikus/4227782 to your computer and use it in GitHub Desktop.
Save sputnikus/4227782 to your computer and use it in GitHub Desktop.
Eliminate duplicate dicts from list
# 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