You can do it very simply like this:
newdict = {}
for key, value in olddict.items():
for string in value:
newdict.setdefault(string, []).append(key)
More Related Contents:
- How to select random key with common values?
- How to remove [ ] and ” from Python output [duplicate]
- How to return dictionary keys as a list in Python?
- Replace values in a pandas series via dictionary efficiently
- How to merge multiple dicts with same key or different key?
- Why is dictionary ordering non-deterministic?
- Error: ” ‘dict’ object has no attribute ‘iteritems’ “
- How to save a dictionary to a file?
- How do I format a string using a dictionary in python-3.x?
- count the number of occurrences of a certain value in a dictionary in python?
- TypeError: ‘dict_keys’ object does not support indexing
- What is the purpose of collections.ChainMap?
- One liner: creating a dictionary from list with indices as keys
- Get all keys of a nested dictionary [duplicate]
- Accessing items in an collections.OrderedDict by index
- Is there anything faster than dict()?
- Why is a class __dict__ a mappingproxy?
- Extract a subset of key-value pairs from dictionary?
- Are there any reasons not to use an OrderedDict?
- Python – Printing a dictionary as a horizontal table with headers
- How to get count dict of items but maintain the order in which they appear?
- How do I return dictionary keys as a list in Python?
- Changing one dict changes all dicts in a list of dicts [duplicate]
- Python dictionary replace values
- enumerate() for dictionary in Python
- Appending to list in Python dictionary [duplicate]
- How to change all the dictionary keys in a for loop with d.items()?
- How to convert string representation of dictionary in Pandas DataFrame to a new columns?
- How to convert only numbers in a mixed list into float
- TypedDict when keys have invalid names