title: Creating an OrderedDict from a csv file
body: <p>What I am trying to do is take a csv file with several rows and columns of data and make an ordered dictionary that I can call on and iterate through later.</p>
  
  <p>This is what it looks like when I open and print the csv file in my python shell:</p>
  
  <p><img src="https://i.stack.imgur.com/wVBLB.png" alt="&quot;csv printed&quot;"></p>
  
  <p>​And here is the code I have now and am playing with in the shell:</p>
  
  <pre><code>from collections import OrderedDict
  
  aDict = OrderedDict()
  order = next(csv.reader(file))[1:]
  file.seek(0)
  csvReader = csv.DictReader(file)
  for row in csvReader:
      key = row.pop("key")
      aDict[key] = OrderedDict((k, row[k]) for k in order)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/47faN.png" alt="&quot;my unworking code&quot;"></p>
  
  <p>I want it to iterate over each line and write the dictionary with the keys being the dates and the values as a list of the other values in each column.</p>
  
  <p>Ex: {"12/12/1980" : [28.75,28.87,28.75,28.75,2093900.0,0.0,1.0]}</p>