title: Python write dictionary to csv with header
body: <p>I want to write a specific python dictionary to csv with header. I have looked at other questions but none of them have the similar dictionary structure as mine:</p>
  
  <pre><code>myDic = { "a" : 1, "b" : 2, "c" : 15}
  
  header = ["word", "count"]
  
  with open('myFile.csv', 'w', encoding='utf-8-sig') as f:
      w = csv.DictWriter(f, header)
      w.writeheader()
      w.writerow(myDic)
  </code></pre>
  
  <p>What I got is only <code>word,count</code> in my CSV file. I am using python 3.</p>