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.
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