title: Python remove duplicate values of one key in dict
body: <p>I have a dictionary like this:</p>
  
  <pre><code>Files:
  {'key1': ['path1', 'path1', 'path2', 'path1', 'path2'], 
  'key2': ['f', 'f', 'f', 'f', 'f'], 
  'key_file': ['file1', 'file1', 'file2', 'file1', 'file2']}
  </code></pre>
  
  <p>I want to delete all the duplicate values und in 'key_file' and their other values in the other keys ('key1' and 'key2').</p>
  
  <p>Desired dictionary:</p>
  
  <pre><code>Files:
  {'key1': ['path1', 'path2'], 
  'key2': ['f', 'f'], 
  'key_file': ['file1', 'file2']}
  </code></pre>
  
  <p>I couldn't figure out a solution which preserved the order and deleted every duplicate item and their values in the other keys.</p>
  
  <p>Thanks a lot.</p>
  
  <p>EDIT:</p>
  
  <pre><code>'key2': ['f', 'f', 'f', 'f', 'f']
  </code></pre>
  
  <p>becomes</p>
  
  <pre><code>'key2': ['f', 'f'],
  </code></pre>
  
  <p>because there are two distinct files.</p>
  
  <p>I don't want to delete every duplicate in every key. 'path1' is related to 'file1' and 'path2' is related to 'file2' as is the 'f' in key2 for both cases. Actually in reality there are several keys more, but this is my minimal example. That is my problem. I have found several solutions to delete every duplicate.</p>
  
  <p>EDIT2:</p>
  
  <p>Maybe I was a bit confusing.</p>
  
  <p>Every key has the same length as they describe a filename (in key_file), the according path (in key1) and some other describing strings (in key2, etc). It can happen that the same file is stored in different locations (paths), but I know, that it is the same file if the filename is exactly the same.</p>
  
  <p>Basically what I was looking for, is a function which detects the second value of key_file with the filename file1 as a duplicate of the first value file1 and deletes the second value from every key. The same for value number 4 (file1) and 5 (file2). The resulting dictionary would then look like the one I mentioned.</p>
  
  <p>I hope this explains it better.</p>