I'm new to python and have a csv file with names and scores in like this:
Andrew,10
Steve,14
Bob,17
Andrew,11
I need to know how to read this file, and the file must display the two entries with the same name, for instance Andrew,10 and Andrew,11 as Andrew,10,11. I also need to be able to sort by either name, highest score, or average score. If possible, I'd also like it to use the last 3 entries for each name only. This is the code i've tried to use to read and sort by name:
with open("Class1.csv", "r") as f:
Reader = csv.reader(f)
Data = list(Reader)
Data.sort()
print(Data)