How do i modify a text(csv) file?

by: davidjackson1955, 9 years ago



from jdcal import gcal2jd, jd2gcal


##working.csv record layout:
## yr,mo,Day
##2015,01,01,2015.001, 104,  6.9,  13,1
##2015,01,02,2015.004, 122,  8.0,  31,1
##2015,01,03,2015.007, 102,  7.3,  17,1
##2015,01,04,2015.010, 105,  9.1,  27,1
##2015,01,05,2015.012,  88,  8.2,  29,1

dat = open('/home/pi/Data/working.csv','r').read()

# There are 366 records in the "working.csv" file:
while x <=len(dat)::

     jd = gcal2jd(2000,1,1)
     JDay =  jd[1]+ 2400000.5
     print(JDay)

##Output file record layout:
##JDay,2015,01,02,2015.004, 122,  8.0,  31,1

open('/home/pi/Data/JDay.csv','w')







You must be logged in to post. Please login or register an account.



Really unsure about your objective here, but the method should be to use Pandas for this.

-Harrison 9 years ago

You must be logged in to post. Please login or register an account.