Deleting duplicates in list of lists in Python 2.7 -


  • trenutno_stanje list
  • povijest list of lists
  • epsilon_okolina function 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

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -