I would like to know how if there exists any python function to merge two dictionary and combine all values that have a common key.
I have found function to append t
There is no built-in function for this but you can use a defaultdict for this:
from collections import defaultdict d = defaultdict(list) for other in [d1, d1]: for k, v in other.items(): d[k].append(v)