И это всё МОЁ

max_list_from_all_plates is the main list max_list is the sublist a new list is the copy of the sublist, I try to remove all max from the sublist copy and have an error: list.remove(x): x not in list


if name == «main»:


max_index = 0
max_list_from_all_plates = []

threshold = 0.05

for single_lp in seq:
maximum_plate_prob = []
possible_plate_prob = []
max_list = []

for sign in single_lp:
high_indexes = []
for prob_id in range(0,len(sign)):
if threshold<sign[prob_id]:
high_indexes.append([sign[prob_id], prob_id, CATEGORIES[prob_id]])
max_list.append(high_indexes)
max_list_from_all_plates.append(max_list)
h = high_indexes[0]

newlist = max_list
ma = [max(h) for h in max_list]
print("max_list", ma)

#m = [max() for h in newlist]
#print(max_list_from_all_plates)

for i in newlist:
x = i[0]
m = [max(x) for x in newlist]
#print(m)
print(m)
newlist.remove(m)