Deleting duplicates in list of lists in Python 2.7 -
trenutno_stanjelistpovijestlist of listsepsilon_okolinafunction gives list string (pocetno):trenutno_stanje.append(pocetno) trenutno_stanje.extend(epsilon_okolina[pocetno]) povijest.append(trenutno_stanje)
povijest should essentialy list of lists, somehow in code duplicates entities in way can avoided.
what know how remove duplicate of strings in lists of list? tried:
for p in povijest: p=list(set(p)) but changed nothing
>>> b = [[1,2,3, 3], [3, 2, 4,4]] >>> b = [ list(set(x)) x in b ] >>> b [[1, 2, 3], [2, 3, 4]]
Comments
Post a Comment