Hi all,
I am trying to use the following python code to read data from two .csv files which have data in the following format, e.g.
1, 23.27, 23.21, 83.22
2, 34.25, 65.31, 34.75
... etc
I seem to be getting an error around during execution of the function. I would really appreciate some help in fixing this problem.
import csv
Or = csv.reader(open('Or.csv'))
Ne = csv.reader(open('Ne.csv'))
def make_dict(data):
return OrderedDict((d.split(',',1)[0],d) for d in data if d)
updated = make_dict(Or)
updated.update(make_dict(Ne))
# Write new data to file.csv
Thank-you