Let's say that we have this array:
people = [[Amy, 25], [Bella, 30], [Charlie, 29], [Dean, 21], [Elliot, 19]]
And I have a list of names that I want to remove from it:
people_rem = [Amy, Charlie, Dean]
So that our final array will look like this:
final_people = [[Bella, 30], [Elliot, 19]]
I have tried doing this using list comprehension, which works, but it's incredibly slow (not in this specific case, but in my real life usage i have a lot of lists with a lot more items):
final_people = [person for person in people if people[0] not in people_rem]
How would I do this in a way that's efficient and fast?