I want to filter data based on items in drop.
data = [
['Basket', 'NBA ET', 'Kobe'],
['Basket', 'NCAA', 'Shaq'],
['Basket', 'ENG', 'Shaq'],
]
drop = ['NBA', 'NCAA']
And because I want the list with NBA ET to be left out too, it must be something beyond:
filtered = [d for d in data if d[1] not in drop] # assume d[1] will hold
What I need is:
# pseudocode
filtered = [d for d in data if _ not in d[1] for _ in drop]
but I can never remember the syntax.
For the record, filtered should results in [['Basket', 'ENG', 'Shaq']]