title: How do i convert a dictionary with unequal list as value to csv
body: <p>I have a dictionary with an unequal list as values like this</p>
  
  <pre><code>dict_data = {
      "Data 1": ["cool", "fantastic"],
      "Data 2": ["spam", "hello", "howdy", "foo"],
      "Data 3": ["good morning"],
  }
  </code></pre>
  
  <p>I want something like this as output</p>
  
  <pre><code>Data 1     Data 2  Data 3
  cool       spam    good morning
  fantastic  hello
             howdy
             foo
  </code></pre>
  
  <p>I have tried this which I found on this forum</p>
  
  <pre><code>def transpose(cols):
      return map(lambda *row: list(row), *cols)
  
  with open('result.csv','w') as out_file:
      writer = csv.writer(out_file,dialect = 'excel')
      headers = dict_data.keys()
      items = transpose(dict_data.values())
      writer.writerow(headers)
      writer.writerows(items)
  </code></pre>
  
  <p>But it only outputs the first row</p>
  
  <pre><code>Data 1     Data 2  Data 3
  cool       spam    good morning
  </code></pre>