Python Forum
Use one list as search key for another list with sublist of list
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Use one list as search key for another list with sublist of list
#3
Thank you for your time and answer Smile
I wanted to go further and then compare the first item of the vector's list only so I tried the code bellow but I get a TypeError:

S = set(tuple(x[1]) for x in list1[0])
result = [x for x in list2[0] if tuple(x[1]) not in S]
Reply


Messages In This Thread
RE: Use one list as search key for another list with sublist of list - by jc4d - Jan-10-2022, 09:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Entry field random pull from list, each return own line Bear1981 6 691 Feb-25-2025, 06:09 AM
Last Post: Pedroski55
  removing one list element without using its index paul18fr 7 1,008 Feb-22-2025, 07:59 PM
Last Post: DeaD_EyE
  question about changing the string value of a list element jacksfrustration 4 1,986 Feb-08-2025, 07:43 AM
Last Post: jacksfrustration
  knowing for loop position in a list medic5678 4 655 Jan-31-2025, 04:19 PM
Last Post: perfringo
  help to parser arguments list absolut 3 601 Jan-15-2025, 03:19 AM
Last Post: BashBedlam
  Get an FFMpeg pass to subprocess.PIPE to treat list as text file? haihal 2 978 Nov-21-2024, 11:48 PM
Last Post: haihal
  List comprehension not working right Cris9855 3 902 Nov-04-2024, 03:46 PM
Last Post: DeaD_EyE
  What is a faster way to deep copy a nested list without using .deepcopy()? Shervin_Ataeian 1 1,317 Oct-13-2024, 01:28 PM
Last Post: Pedroski55
  Make a list learningpythonherenow 1 793 Oct-11-2024, 11:49 AM
Last Post: Pedroski55
  Merge list Simso 2 720 Oct-03-2024, 01:44 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020