I have a file that contains the following data:
1,0.00008118
1,0.00008101
12,0.00008122
5,0.00008091
8,0.00008092
1,0.00008109
2,0.00008100
260,0.00008087
248,0.00007982
69,0.00007958
71,0.00007954
51,0.00007910
20,0.00007932
I'd like to be able to sort the file so that the integer values are sorted lowest to highest. When sorting using the sorted function, it appears to be sorting numerically instead.
a_s = sorted(List)
for i in a_s:
print(i)
So the output is:
1,0.00008101
1,0.00008109
1,0.00008118
12,0.00008122
2,0.00008100
20,0.00007932
248,0.00007982
260,0.00008087
5,0.00008091
51,0.00007910
69,0.00007958
71,0.00007954
8,0.00008092
How would i get it so that the numerical values are sorted the lowest to highest value?
Many Thanks,