ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 13 Dec 2017 15:08:16 +0100saving to a .csv filehttps://ask.sagemath.org/question/40137/saving-to-a-csv-file/ In my computations I got a list of strings:
vect = ['00011', '00010', '01011', '01111', '01100']
I need to save it as .csv file, each element row by row, ideally like this:
00011
00010
01011
01111
01100
I use a code:
import csv
C = vect
with open('file_path_vec.csv', 'w') as f:
c = csv.writer(f)
c.writerows(C)
But what I get in my .csv looks like this:
0,0,0,1,1
0,0,0,1,0
0,1,0,1,1
0,1,1,1,1
0,1,1,0,0
Why does it add commas in between? How can I get rid of them?XeniaWed, 13 Dec 2017 15:08:16 +0100https://ask.sagemath.org/question/40137/