Heres what my data looks like:
What I'm trying to accomplish is add columns 3 and 4 together and create a new column right next to column 4 in the csv file before the column with the "right, left" options
For example the values in the new column would be:
7
7
7
7
7
Here is my code for doing this which is not working:
def computed_column(csvfile):
with open(csvfile,newline='') as f:
with open('combined_csv.csv','w',newline='') as f2:
writer = csv.writer(f2)
rows = csv.reader(f)
for row in rows:
y=[]
y.append(int(row[2]) + int(row[3]))
writer.writerow(row+y)