title: Trouble writing a dictionary to csv with keys as headers and values as columns
body: <p>I have a  dictionary that looks like:</p>
  
  <pre><code>mydict = {"foo":[1,2], "bar":[3,4], "asdf":[5,6]}
  </code></pre>
  
  <p>I'm trying to write this to a CSV file so that it looks like:</p>
  
  <pre><code>foo,bar,asdf
  1,3,5
  2,4,6
  </code></pre>
  
  <p>I've spend the last hour looking for solutions, and the closest one I found suggested doing something like this:</p>
  
  <pre><code>headers = mydict.keys()
  with open("File2.csv","w") as f:
      writer = csv.writer(f)
      writer.writerow(headers)
      writer.writerows(zip(mydict.values())
  </code></pre>
  
  <p>This writes the headers ok, but not the values. Here is my output:</p>
  
  <pre><code>foo,bar,asdf
  [1,2]
  [3,4]
  [5,6]
  </code></pre>
  
  <p>How do I get to the output I need? I'd really appreciate some help. Thank you</p>