remove duplicate values from items in a dictionary in Python
<p>How can I check and remove duplicate values from items in a dictionary?
I have a large data set so I'm looking for an efficient method. The following is an example of values in a dictionary that contains a duplicate:</p>

<pre><code>'word': [('769817', [6]), ('769819', [4, 10]), ('769819', [4, 10])]
</code></pre>

<p>needs to become </p>

<pre><code>'word': [('769817', [6]), ('769819', [4, 10])]
</code></pre>

<p>How about this:
I am just focusing on the list part:</p>

<pre><code>&gt;&gt;&gt; s = [('769817', [6]), ('769819', [4, 10]), ('769819', [4, 10])]
&gt;&gt;&gt; [(x,y) for x,y in {key: value for (key, value) in s}.items()]
[('769817', [6]), ('769819', [4, 10])]
&gt;&gt;&gt;
</code></pre>

python dictionary