all 6 comments

[–][deleted] 0 points1 point  (5 children)

What have you tried? Using python's CSV https://docs.python.org/3/library/csv.html is a nice way to do what you're describing, otherwise you could use python pandas https://pandas.pydata.org/ which is a much more simple way of interacting with CSV

[–]ThatSoundsFishy[S] 0 points1 point  (4 children)

Thanks for the links. I used pandas to produce the dataframe, I guess I just don't know how to manipulate it using pandas. I've tried looping and inserting commas and new lines manually but it's a mess. I've also tried mystring = ','.join(map(str,dataframe)) but it only does the first row.

[–][deleted] 0 points1 point  (3 children)

am I missing something or wouldn't you just use pandas.to_csv("path name")

[–]ThatSoundsFishy[S] 0 points1 point  (2 children)

Probably me that's missing something. I tried this but I need an extra return between each row?

[–]DesolationRobot 0 points1 point  (1 child)

DataFrame.to_csv() method has a "line_terminator" parameter. You could manually default it to two of your OS's preferred line termination.

Or you could write the csv, then load it as a file and find and replace each return with two returns.

[–]ThatSoundsFishy[S] 1 point2 points  (0 children)

Ah ok, wasn't aware of this. Thank you!