python 3.x - How to save a list into different column of a csv file -
a loop iterating on column in numpy , after having several operation final column value have save in csv file. if there 8 column loop rotate 8 times , each time result have write in different column of csv file. how write csv writer ?
so assume you're saying have numpy array so:
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
and each column, math:
10 20 30 40 20 40 60 80 30 60 90 120 40 80 120 160
then need save csv file:
10,20,30,40 20,40,60,80 30,60,90,120 40,80,120,160
in case i'd numpy , pandas (psuedocode):
import numpy import pandas pd array = numpy.array([[0,0,0,0]]*4) domaths(array) pd.dataframe(array).to_csv("maths.json")
Comments
Post a Comment