Skip to content

Instantly share code, notes, and snippets.

@akash0x53
Created February 12, 2015 18:14
Show Gist options
  • Save akash0x53/29113421e621753a3e67 to your computer and use it in GitHub Desktop.
Save akash0x53/29113421e621753a3e67 to your computer and use it in GitHub Desktop.
Remove duplicate dict from list of dicts
a = {
"a": 123,
"b": 456
}
l = [a, a]
print l
remove_dups = [dict(t) for t in set([tuple(d.items) for d in l])]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment