title: Reading csv file in Python and create a dictionary
body: <p>I am trying to read a csv file in python 27 to create a dictionary. CSV file looks like-</p>
  
  <blockquote>
    <p>SI1440269,SI1320943,SI1321085 
    SI1440270,SI1320943,SI1321085,SI1320739
    SI1440271,SI1320943<br>
    SI1440273,SI1321058,SI1320943,SI1320943</p>
  </blockquote>
  
  <p>Number of entries in each row are not fixed. First column entries should be my keys. My code -</p>
  
  <pre><code>import csv
  reader = csv.reader(open('test.csv'))
  
  result = {}
  for column in reader:
      key = column[0]
      if key in result:
          pass
      result[key] = column[1:]
  print result
  </code></pre>
  
  <p>Output:</p>
  
  <blockquote>
    <p>{'SI1440273': ['SI1321058', 'SI1320943', 'SI1320943'], '': ['', '', ''], 'SI1440271': ['SI1320943', '', ''], 'SI1440270': ['SI1320943', 'SI1321085', 'SI1320739'], 'SI1440269': ['SI1320943', 'SI1321085', '']}</p>
  </blockquote>
  
  <p>How can I get rid of null values in the output?
  Also, how can I have my key values in the output to be in the same order as in csv file?</p>
  
  <p>Edit:
  I want single row per 'key'</p>