title: convert csv to dictionary
body: <p>I have the following csv file(total <code>20000</code> lines)</p>
  
  <pre><code>ozone,paricullate_matter,carbon_monoxide,sulfure_dioxide,nitrogen_dioxide,longitude,latitude,timestamp,avg_measured_time,avg_speed,median_measured_time,timestamp:1,vehicle_count,lat1,long1,lat2,long2,distance_between_2_points,duration_of_measurement,ndt_in_kmh
  99,99,98,116,118,10.09351660921,56.1671665604395,1407575099.99998,0,0,0,1407575099.99998,0,56.1089513576227,10.1823955595246,56.1048021343541,10.1988040846558,1124,65,62
  99,99,98,116,118,10.09351660921,56.1671665604395,1407575099.99998,0,0,0,1407575099.99998,0,56.10986429895,10.1627288048935,56.1089513576227,10.1823955595246,1254,71,64
  99,99,98,116,118,10.09351660921,56.1671665604395,1407575099.99998,0,0,0,1407575099.99998,0,56.1425188527673,10.1868802625656,56.1417522836526,10.1927236478157,521,62,30
  99,99,98,116,118,10.09351660921,56.1671665604395,1407575099.99998,18,84,18,1407575099.99998,1,56.1395320665735,10.1772034087371,56.1384485157567,10.1791506011887,422,50,30
  </code></pre>
  
  <p>I want to convert this into a dictionary like </p>
  
  <pre><code>{'ozone': [99,99,99,99], 'paricullate_matter': [99,99,99,99],'carbon_monoxide': [98,98,98,98],etc....}
  </code></pre>
  
  <p>What i have tried</p>
  
  <pre><code>import csv
  
  reader = csv.DictReader(open('resulttable.csv'))
  
  output = open("finalprojdata.py","w")
  
  result = {}
  for row in reader:
      for column, value in row.iteritems():
          result.setdefault(column, []).append(float(value))
  output.write(str(result))
  </code></pre>
  
  <p>The output am getting is consisting of only few dictionaries. Like from</p>
  
  <pre><code>{'vehicle_count': [0,0,0,1], 'lat1': etc}
  </code></pre>
  
  <p>The whole csv file is not getting converted to dictionary.</p>