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
  sort list of dictionaries by value jacksfrustration 4 264 Jun-21-2024, 08:44 PM
Last Post: deanhystad
  List with equal repeatable data Ataman 6 348 Jun-13-2024, 07:30 PM
Last Post: Ataman
  Downloading Page Source From URL List zunebuggy 11 581 Jun-08-2024, 06:40 AM
Last Post: Pedroski55
  how to capitalize letter in list object Python iwonkawa 4 316 May-29-2024, 04:29 PM
Last Post: DeaD_EyE
  remove duplicates from dicts with list values wardancer84 27 1,228 May-27-2024, 04:54 PM
Last Post: wardancer84
  what to return for an empty list Skaperen 2 324 May-24-2024, 05:17 PM
Last Post: Skaperen
  Extending list doesn't work as expected mmhmjanssen 2 365 May-09-2024, 05:39 PM
Last Post: Pedroski55
  Strange behavior list of list mmhmjanssen 3 525 May-09-2024, 11:32 AM
Last Post: mmhmjanssen
  Sort a list of dictionaries by the only dictionary key Calab 2 782 Apr-29-2024, 04:38 PM
Last Post: Calab
  element in list detection problem jacksfrustration 5 672 Apr-11-2024, 05:44 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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