0

I'm trying to put my dictionary of information in a CSV file, but I want it to be this way: each key and its values in the same column. This method gives each key and its value in the same row, I need to put key and value in the same column Can anyone help, please? Thank you

for key, val in d.items():
    w.writerow([key, val])
output.close() ```

Ismahene
  • 11
  • 2
  • Does this answer your question? [How do I convert this list of dictionaries to a csv file?](https://stackoverflow.com/questions/3086973/how-do-i-convert-this-list-of-dictionaries-to-a-csv-file) – CodeTalker Apr 11 '20 at 18:02
  • @CodeTalker: no, that puts each datum in a separate column. – Prune Apr 11 '20 at 18:04
  • I linked to a duplicate -- in that the *question* shows how to write all the data to one column, while the *problem* is to separate the list. – Prune Apr 11 '20 at 18:05

0 Answers0