반응형
* 파이썬에서 csv 파일 쓰기 **
* Assume you want to write numbers from 1 to 8 along the first column of a csv file;
// CODE ///////////////////////////
import csv
fp = open('/home/test.csv','w') //
csvWriter = csv.writer(fp, lineterminator = '\n')
for i in range(1,9):
csvWriter.writerow([i])
fp.close()
'Python' 카테고리의 다른 글
How to resize an image : skimage library (0) | 2017.08.01 |
---|---|
How to show an image : skimage library (0) | 2017.07.21 |
How to plot a graph : mathplotlib library (0) | 2017.07.21 |
[NYU depth] How to read NYU depth dataset in python (0) | 2017.07.20 |
How to read values from csv files (0) | 2017.07.18 |