List1 = [['A0.01', 'GENERIC NOTES'],['A0.02', 'ANOTHER GENERIC NOTE'],['A0.03', 'YET ANOTHER GENERIC NOTE']]
List2 = ['A0.01','A0.03']
and I want to find the intersection of the two lists and return a list of all items if there is a match. Below is what I have tried:
result = [[j for j in view if j in List2] for view in List1]
This returns me the matching values in List1
[['A0.01'],[],['A0.03']]
but I want the rest of the values within that matching list item as well. Below is what I intend the result to be:
['A0.01', 'GENERIC NOTES'],['A0.03', 'YET ANOTHER GENERIC NOTE']
How can I achieve this. I appreciate any help!