I would like to add hundreds of new lines in two columns in my csv files which is presented like this (with Sublime Text):
4564,"2,82402927004573E-05"
4565,"3,43440547204476E-05"
4566,"4,04519168926086E-05"
4567,"4,65639435774783E-05"
4568,"5,26796365520546E-05"
4569,"5,87994985608482E-05"
4570,"6,49231317058272E-05"
And I would like to add lines like this:
4564,"2,82402927004573E-05"
4565,"3,43440547204476E-05"
4566,"4,04519168926086E-05"
4567,"4,65639435774783E-05"
4568,"5,26796365520546E-05"
4569,"5,87994985608482E-05"
4570,"6,49231317058272E-05"
4571,"0"
4572,"0"
4573,"0"
etc...
I have tried this code:
from csv import reader
import numpy as np
import csv
from mpdaf.obj import Spectrum, WaveCoord
wave = range(7308, 9349, 1)
with open('transmission_curve_HST_ACS_HRC.F606W.csv', 'a') as f:
writer = csv.writer(f)
writer.writerow(wave)
But as I've seen it adds all the data from wave
on one line at the end, yet I would like to add it as one data per line in the first column.
Any idea how to do this ?
Thank you