Python: CSV write by column rather than row

后端 未结 7 954
春和景丽
春和景丽 2020-12-01 03:46

I have a python script that generates a bunch of data in a while loop. I need to write this data to a CSV file, so it writes by column rather than row.

For example in

7条回答
  •  攒了一身酷
    2020-12-01 04:17

    Read it in by row and then transpose it in the command line. If you're using Unix, install csvtool and follow the directions in: https://unix.stackexchange.com/a/314482/186237

提交回复
热议问题