I have 2 columns and in each column I have 5 words in each row.
For example:
x=[dog|cat|mouse|new|world]
y=[fish|cat|new|thing|nice]
And I need to find intersections between them [cat|new].
But it shows me an empty list. Do you know why?
data = pd.read_csv('data.csv')
intersect1=[]
for j in range(len(data)):
#print('==========================================================================')
x=str(data.iloc[:, 2]).split("|")
y=str(data.iloc[:, 3]).split("|")
#get_jaccard_sim(x, y)
#intersect.append(result)
intersect= list(set(x) & set(y))
intersect1.append(intersect)
#print(inter)
print(intersect1)