This is my list :
vec = [[(0, 6.369426751591834e-05),
(1, 6.369426751591834e-05),
(2, 6.369426751591834e-05),
(3, 6.369426751591834e-05),
(4, 6.369426751591834e-05),
(5, 6.369426751591834e-05),
(6, 6.369426751591834e-05),
(7, 0.0007714083510261222),
(8, 6.369426751591834e-05),
...........................
(4995, 6.369426751591834e-05),
(4996, 6.369426751591834e-05),
(4997, 6.369426751591834e-05),
(4998, 6.369426751591834e-05),
(4999, 6.369426751591834e-05)]]
I want to sort it based 2nd column which has float value. Plus how to print first 10 from the output list. I tried many methods, but couldn't figure out. Any suggestions?
sorted(vec[0], key=lambda x: x[1])