title: Read a CSV file and Append to dictionary
body: <p>please how can I loop through all lines in the csv file RESULT4, then check the list of tuples BR to see if the first and second element in each tuple is a match with the values in the columns NodeA and NodeB respectively and add the corresponding value in the LOAD column into the dictionary element in BR if they match. Thank you</p>
  
  <pre><code>RESULT4.csv = Link  NodeA   NodeB   LOAD
                 4    71001   8427    961.325492
                 6    71002   71009   17.302306
                12    71004   8430    0.642499
                15    71003   8429    3.685375
                16    71006   8833    1.291624
                18    71007   71008   6.536354
                20    71009   70514   65.200511
  
  
  BR = [(71001, 8427,{'lanes': 9, 'length': 0.1,}),(71003, 8429,{'lanes': 9, 'length': 0.8,}),(71007, 71008,{'lanes': 6, 'length': 0.3,}), (7100, 7104,{'lanes': 6, 'length': 0.3,})]
  </code></pre>
  
  <p>I tried this but I dont get the desired result.</p>
  
  <pre><code>with open('RESULT4.csv', 'rb') as f:
      reader = csv.reader(f)
          for row in reader:
              if (BR[0][0]).find(row[1]) and (BR[0][1]).find(row[2]):
              BR[0][2]['volume'] = str(row[3])
  print BR
  </code></pre>
  
  <p>The output should look thus:</p>
  
  <pre><code>BR = [(71001, 8427,{'volume': 961.325492, 'lanes': 9, 'length': 0.1,}),(71003, 8429,{'volume': 3.685375,'lanes': 9, 'length': 0.8,}),(71007, 71008,{'volume': 6.536354,'lanes': 6, 'length': 0.3,}), (7100, 7104,{'lanes': 6, 'length': 0.3,})]
  </code></pre>