Combine dictionaries based on key value
<p>How do I combine the rows of dictionaries having same keys. For instance If I have </p>

<pre><code>my_dict_list = [{'prakash': ['confident']},
 {'gagan': ['good', 'luck']},
 {'jitu': ['gold']},
 {'jitu': ['wins']},
 {'atanu': ['good', 'glory']},
 {'atanu': ['top', 'winner','good']}]
</code></pre>

<p>My objective is to get </p>

<pre><code>my_new_dict_list = [{'prakash': ['confident']},
 {'gagan': ['good', 'luck']},
 {'jitu': ['gold','wins']},
 {'atanu': ['good', 'glory','top', 'winner','good']}]
</code></pre>

<p>How do I do that in Python?</p>

<p>EDIT: The dictionaries in the final list must contain repeated values if present in starting list. </p>

<pre><code>my_dict_list = [{'prakash': ['confident']},
{'gagan': ['good', 'luck']},
{'jitu': ['gold']},
{'jitu': ['wins']},
{'atanu': ['good', 'glory']},
{'atanu': ['top', 'winner','good']}]

my_new_dict_list = []
tmp_dict = {}
order = []

for d in my_dict_list:
    for k, v in d.iteritems():
        if not k in order: order.append(k)
        tmp_dict.setdefault(k, []).extend(v)

my_new_dict_list = [ {x: tmp_dict[x] } for x in order ]
</code></pre>

<p>Output:</p>

<pre><code>[{'prakash': ['confident']},
 {'gagan': ['good', 'luck']},
 {'jitu': ['gold', 'wins']},
 {'atanu': ['good', 'glory', 'top', 'winner', 'good']}]
</code></pre>

python