Can you also post the sample file you're reading the data from?
In the meantime, I think this code can help you figure this out:
In the meantime, I think this code can help you figure this out:
#Original data data =((1,19),(2,10),(3,4),(2,7)) #Built-in sort function print (sorted(data)) #define new sort criteria print(sorted(data,key = lambda e: e[1]))