You can use the collections.Counter
counter = collections.Counter()
for d in dict1:
counter.update(d)
Or, if you prefer oneliners:
functools.reduce(operator.add, map(collections.Counter, dict1))
More Related Contents:
- How to sum all the values in a dictionary?
- Connecting data in python to spreadsheets
- How to remove [ ] and ” from Python output [duplicate]
- How can I add new keys to a dictionary?
- Get key by value in dictionary
- Convert [key1,val1,key2,val2] to a dict?
- Convert nested Python dict to object?
- Return a default value if a dictionary key is not available
- Change the name of a key in dictionary
- Convert Django Model object to dict with all of the fields intact
- How to pretty print nested dictionaries?
- Finding a key recursively in a dictionary
- Intersecting two dictionaries
- Python dictionary keys. “In” complexity
- How to convert list of key-value tuples into dictionary?
- how to iterate through dictionary in a dictionary in django template?
- Subclassing Python dictionary to override __setitem__
- Combining Dictionaries Of Lists In Python
- Set attributes from dictionary in python
- Python 3 dictionary with known keys typing
- Is there a better way to compare dictionary values
- Python built-in sum function vs. for loop performance
- Initialize List to a variable in a Dictionary inside a loop
- How to get count dict of items but maintain the order in which they appear?
- How can I get a random key-value pair from a dictionary?
- Disabling sorting mechanism in pprint output
- Getting the difference (delta) between two lists of dictionaries
- Python: iterating over list vs over dict items efficiency
- What’s the best way to sum all values in a Pandas dataframe? [duplicate]
- How to raise error if duplicates keys in dictionary