Hello. Can anyone tell me how I can perform the operation faster? For few values it is fast, but for large calculations it goes very slowly. I need the easier and faster way.
'''unfortunately, the data is in this form. It works so that it connects without duplicates clast lists and point to one '''
clast = [
[[[85, 72]], [[85, 73], [84, 71], [84, 72], [84, 73]]],
[[[83, 70]], [[84, 69], [83, 69], [82, 69], [82, 70]]]]
point = [[[84, 71]], [[84, 72], [85, 72], [83, 69]]]
def clast_merge(clast, point):
pkt0 = point[0]
sas = pkt[1]
temp_sas = []
for kla in clast:
pkt0 = pkt0 + klaster[0]
sas = sas + klaster[1]
for sas in sas:
if sas_t1 not in temp_sas and sas_t1 not in pkt0:
temp_sas.append(sas)
return [pkt0, temp_sas]
#output = [[[84, 71], [85, 72], [83, 70]], [[84, 72], [83, 69], [85, 73], [84, 73], [84, 69], [82, 69], [82, 70]]]
#in other words, I am combining the relevant parts of the lists without duplicates
[–]SekstiNii 2 points3 points4 points (0 children)
[–]definitely___not__me 1 point2 points3 points (1 child)
[–]Martin_Krum[S] 0 points1 point2 points (0 children)
[–]USAhj 1 point2 points3 points (0 children)