title: Python writing a csv to a list of dictionaries with headers as keys and rows as values
body: <p>I have a csv file, <code>test.csv</code>, as shown:</p>
  
  <pre><code>1,2,3
  a,b,c
  d,e,f
  </code></pre>
  
  <p>I want the above to look like a dictionary as shown:</p>
  
  <pre><code>{"1":"a", "2":"b", "3":"c"}
  {"1":"d", "2":"e", "3":"f"}
  </code></pre>
  
  <p>where the header <code>1,2,3</code> are the keys and the rows are values.</p>
  
  <p>I don't quite understand how to get this done using csv.DictReader. The above sample is just that, a sample. The actual data that I'm working with has many columns, and hence, I cannot access each row by using its index and manually putting them into a dictionary. </p>