While following this answer by @adrtam. I tried to find exact match for line using
A)
print(rules[rules["antecedents"].apply(lambda x: 'line' in x)])
and
B)
print(rules[rules["antecedents"].apply(lambda x: 'line' == x)])
C)
print(rules[rules["antecedents"].apply(lambda x: 'line' == str(x))])
A returns the same result of
print(rules[rules["antecedents"].apply(lambda x: 'line' in str(x))])
B and C returns an empty dataframe. I want to print rows with only exact match (not contains). How do I do this with lambda function?
P.S. Posting as a question because I don't have enough reputation to comment.