SHARE
TWEET

Untitled

a guest Jun 19th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. f = open("results.csv", "r")
  2. out = open("out.csv", "w")
  3.  
  4. for line in f:
  5.     data = line.split()
  6.     data[0] = line[4]
  7.     data[5] = str((float(data[2]) + float(data[3]) + float(data[4])) / 3)
  8.     out.write(",".join(data))
  9.     out.write("\n")
  10.  
  11. f.close()
  12. out.close()
RAW Paste Data
Want to get better at Python?
Learn to code Python in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top