хочу посортировать елементы по первому значению [[[[0.052 -по пера, 3, ‘3’], [0.066, 7, ‘7’], [0.051, 13, ‘D’], [0.401, 19, ‘J’], [0.077, 30, ‘V’]],
#for index in listy:
l = len(max_list_from_all_plates)
for i in range(0, l):
print(l)
#for j in range(0, l):
for j in range(0, l-i-1):
print(j)
if (max_list_from_all_plates[j][0] > max_list_from_all_plates[j+ 1][0]):
temp = max_list_from_all_plates[j]
max_list_from_all_plates[j]= max_list_from_all_plates[j + 1]
max_list_from_all_plates[j + 1]= temp
return max_list_from_all_plates
print("max_list_from_all_plates", Sorting(max_list_from_all_plates))
output:
max_list_from_all_plates [[[[0.052, 3, '3'], [0.066, 7, '7'], [0.051, 13, 'D'], [0.401, 19, 'J'], [0.077, 30, 'V']], [[0.462, 7, '7'], [0.052, 15, 'F'], [0.136, 34, 'Z']], [[0.06, 7, '7'], [0.062, 9, '9'], [0.053, 13, 'D'], [0.422, 19, 'J'], [0.065, 30, 'V']], [[0.058, 3, '3'], [0.067, 6, '6'], [0.287, 8, '8'], [0.059, 16, 'G'], [0.118, 27, 'S']], [[0.056, 0, '0'], [0.065, 6, '6'], [0.271, 8, '8'], [0.062, 11, 'B'], [0.061, 27, 'S']], [[0.051, 11, 'B'], [0.051, 14, 'E'], [0.109, 15, 'F'], [0.067, 25, 'P'], [0.286, 26, 'R']], [[0.106, 4, '4'], [0.079, 6, '6'], [0.377, 20, 'K']]], [[[0.054, 7, '7'], [0.051, 10, 'A'], [0.056, 18, 'I'], [0.389, 19, 'J'], [0.07, 30, 'V']], [[0.083, 7, '7'], [0.062, 9, '9'], [0.053, 10, 'A'], [0.055, 18, 'I'], [0.348, 19, 'J'], [0.086, 30, 'V'], [0.055, 32, 'X']], [[0.499, 7, '7'], [0.053, 25, 'P'], [0.123, 34, 'Z']], [[0.054, 6, '6'], [0.369, 8, '8'], [0.1, 16, 'G'], [0.102, 27, 'S']], [[0.075, 6, '6'], [0.365, 8, '8'], [0.075, 16, 'G'], [0.099, 27, 'S']], [[0.11, 15, 'F'], [0.059, 25, 'P'], [0.289, 26, 'R']], [[0.134, 4, '4'], [0.088, 6, '6'], [0.342, 20, 'K']]], [[[0.055, 3, '3'], [0.076, 7, '7'], [0.391, 19, 'J'], [0.068, 30, 'V']], [[0.064, 3, '3'], [0.069, 13, 'D'], [0.379, 19, 'J'], [0.063, 30, 'V']], [[0.458, 7, '7'], [0.052, 25, 'P'], [0.139, 34, 'Z']], [[0.111, 6, '6'], [0.235, 8, '8'], [0.084, 27, 'S']], [[0.103, 6, '6'], [0.289, 8, '8'], [0.108, 16, 'G'], [0.102, 27, 'S']], [[0.053, 8, '8'], [0.119, 15, 'F'], [0.06, 25, 'P'], [0.275, 26, 'R']], [[0.13, 4, '4'], [0.08, 6, '6'], [0.378, 20, 'K'], [0.051, 22, 'M']]], [[[0.064, 3, '3'], [0.076, 13, 'D'], [0.382, 19, 'J'], [0.057, 30, 'V']], [[0.068, 7, '7'], [0.052, 10, 'A'], [0.35, 19, 'J'], [0.099, 30, 'V'], [0.076, 32, 'X']], [[0.517, 7, '7'], [0.114, 34, 'Z']], [[0.064, 3, '3'], [0.052, 6, '6'], [0.36, 8, '8'], [0.067, 16, 'G'], [0.121, 27, 'S']], [[0.079, 6, '6'], [0.259, 8, '8'],
[0.064, 16, 'G'], [0.086, 27, 'S']], [[0.056, 14, 'E'], [0.098, 15, 'F'], [0.069, 25, 'P'], [0.331, 26, 'R']], [[0.096, 4, '4'], [0.095, 6, '6'], [0.36, 20, 'K']]], [[[0.073, 7, '7'], [0.384, 19, 'J'], [0.088, 30, 'V'], [0.066, 32, 'X']], [[0.089, 7, '7'], [0.051, 18, 'I'], [0.387, 19, 'J'], [0.09, 30, 'V'], [0.064, 32, 'X']], [[0.282, 7, '7'], [0.053, 25, 'P'], [0.224, 34, 'Z']], [[0.097, 6, '6'], [0.239, 8, '8'], [0.082, 16, 'G'], [0.11, 27, 'S']], [[0.053, 3, '3'], [0.057, 6, '6'], [0.25, 8, '8'], [0.057, 16, 'G'], [0.092, 27, 'S']], [[0.069, 8, '8'], [0.057, 14, 'E'], [0.096, 15, 'F'], [0.256, 26, 'R']], [[0.174, 4, '4'], [0.085, 6, '6'], [0.357, 20, 'K']]], [[[0.077, 7, '7'], [0.058, 18, 'I'], [0.352, 19, 'J'], [0.089, 30, 'V'], [0.053, 32, 'X']], [[0.075, 3, '3'], [0.36, 19, 'J'], [0.092, 30, 'V'],
[0.058, 32, 'X']], [[0.627, 7, '7'], [0.053, 34, 'Z']], [[0.056, 0, '0'], [0.412, 8, '8'], [0.073, 16, 'G'], [0.074, 27, 'S']], [[0.09, 6, '6'], [0.258, 8, '8'], [0.079, 16, 'G'], [0.106, 27, 'S']], [[0.1, 15, 'F'], [0.317, 26, 'R']], [[0.164, 4, '4'], [0.06, 6, '6'], [0.383, 20, 'K'], [0.063, 22, 'M']]], [[[0.082, 3, '3'], [0.062, 13, 'D'], [0.391, 19, 'J'], [0.061, 30, 'V']], [[0.078, 3, '3'], [0.059, 7, '7'], [0.052, 13, 'D'], [0.366, 19, 'J'], [0.074, 30, 'V']], [[0.299, 7, '7'], [0.056, 25, 'P'], [0.056, 28, 'T'], [0.217, 34, 'Z']],
[[0.06, 3, '3'], [0.09, 6, '6'], [0.234, 8, '8'], [0.052, 16, 'G'], [0.134, 27, 'S']], [[0.053, 6, '6'], [0.269, 8, '8'], [0.098, 27, 'S']], [[0.063, 8, '8'], [0.14, 15, 'F'], [0.055, 25, 'P'], [0.239, 26, 'R']], [[0.186, 4, '4'], [0.107, 6, '6'], [0.3, 20, 'K']]]]
Перемещено Zhbert из general