I want to find the average of three columns in a csv file created from Python. My data is laid out like so:
[User Name, Score1, Score2, Score3]
for example
['James', 5, 8, 9]
I would like to find the average of the scores, 5
, 8
, 9
.
newrecord = "{user_name},{score_1},{score_2},{score_3}\n".format(user_name=userName, score_1=quiz_scores[0], score_2=quiz_scores[1], score_3=quiz_scores[2])
file=open('classroom1.csv', "a+")
file.write(newrecord)
file.close()
with open('classroom1.csv') as csvfile:
readCSV = csv.reader(csvfile)
I don't know what to do after this. Thanks in advance for any feedback.