title: Nested dictionaries from file in Python
body: <p>So I'm trying to create a nested dictionary but I can't seem to wrap my head around the logic.</p>
  
  <p>So say I have input coming in from a csv:</p>
  
  <pre><code>1,2,3
  2,3,4
  1,4,5
  </code></pre>
  
  <p>Now'd like to create a dictionary as follows:</p>
  
  <pre><code>d ={1:{2:3,4:5}, 2:{3:4}}
  </code></pre>
  
  <p>Such that for the first being some ID column that we create keys in the sub dictionary corresponding to second value.</p>
  
  <p>The way I tried it was to go:</p>
  
  <pre><code>d[row[0]] = {row[1]:row[2]}
  </code></pre>
  
  <p>But that overwrites the first instead of appending/pushing to it, how would I go about this problem? I can't seem to wrap my mind around what keys to use.</p>
  
  <p>Any guidance is appreciated.</p>