df1 = pd.DataFrame({"fields": [["boy", "apple", "toy", "orange", "bear", "eat"],
["orange", "girl", "red"]]})
df2 = pd.DataFrame({"other fields": [["boy", "girl", "orange"]})
and I want to add a column to df1 indicating that the fields overlap with other fields, sample output:
|fields| overlap?|
|------|---------|
|boy |Y
|apple |N
|toy |N
|orange|Y
|bear |N
|eat |N
|orange|Y
|girl |Y
|red |N
first I will explode fields on df1, but I am not sure what the next steps are to check overlap values between 2 dataframes. Thanks!