title: Create a python dictionary from a tab delimited file that is not 1:1
body: <p>I want to create two python3 dictionaries from a tab delimited file (no header). The file has 2 columns that I want to name group_id and gene_id. A group may have multiple genes and a gene can belong to multiple groups. I will demonstrate what I want with a simple example.</p>
  
  <pre><code>group_id gene_id
  
  A        a
  A        b
  A        c
  A        d
  B        a
  B        c
  B        e
  </code></pre>
  
  <p>I would like to have 2 dictionaries:</p>
  
  <pre><code>dict1 = {'A':(a,b,c,d),'B':(a,c,e)}
  </code></pre>
  
  <p>and</p>
  
  <pre><code>dict2 = {'a':(A,B), 'b':(A), 'c':(A,B), 'd':(A), 'e':(B)}
  </code></pre>
  
  <p>I would like to store the values in tuples for speed because my file is 2.5 GBs and I will end up with big dictionaries that I have to work with later.</p>
  
  <p>I know there are a lot of questions like this but I can't find an answer from those as they deal with files that have key:value pairs.</p>
  
  <p>Thanks!</p>