Skip to content

Instantly share code, notes, and snippets.

@sai-prasanna
Created August 15, 2013 12:40
Show Gist options
  • Save sai-prasanna/6240529 to your computer and use it in GitHub Desktop.
Save sai-prasanna/6240529 to your computer and use it in GitHub Desktop.
Merge Dictionary and update duplicates
from collections import Counter
a = {'a': 1}
b = {'a': 2, 'b': 3}
c = Counter(a) + Counter(b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment