questions[questions.apply(lambda x: x.concept_code in chapter_to_concepts_dict.get(x.chapter_code, []), axis = 1)] code example
Example: lambda in pandas
Series.apply(lambda x: x**2)
#x represent the cell value and x**2 is your function
Series.apply(lambda x: x**2)
#x represent the cell value and x**2 is your function