so i'm trying to sort by value bunch of data from csv file , but the output is wrong . so any opinion ? Note : i should solve it without pandas.thanks
import csv
import operator
with open('final.csv', 'r') as csvFile:
reader = csv.reader(csvFile)
for row in reader:
sortedlist = sorted(reader, key=operator.itemgetter(1), reverse=True)
for eachline in sortedlist:
print(eachline)
csvFile.close()
and the OUTPUT :
['sara', '9.75']
['soheila', '7.833333333333333']
['hamid', '6.066666666666666']
['ali', '5.0']
['sarvin', '11.375']
['sina', '11.285714285714286']