I want to get the closest match for my row from another data frame but with a condition, I currently have it like this:
df['a'].astype(str).apply(lambda x: difflib.get_close_matches(x,df2['a'].astype(str)))
but i want it to get the closest match from df2['a']
when df['b'] == df2['b']
. How can i put this in the syntax?