How do we remove the repetitions on the list of second element lists?



  • I have a list. For example:

    my_list=[['ewew','bbb','fff'],['123','bbb','fff'],['333','bbb','wff']]
    

    How do you make the list unique in the second element of the subscription?
    Better, of course, through lambda or something fast.



  • unique_list = [l for l in {i[1]: i for i in my_list}.values()]

    There's probably better solutions.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2