It looks like the first for loop only considers the first line in the first csv file and does not continue comparing. I have tried to rewrite it a bunch of ways but now im totally lost so im turning to you guys.
Can anyone tell me if there is anything wrong writing the code as i did here:
with open("./products.csv", mode="r") as products_list1:
with open("./products2.csv", mode="r") as products_list2:
with open("./results.csv", mode="a") as results:
for i in products_list1:
for j in products_list2:
jaccard = get_jaccard_sim(i, j)
if jaccard >= 0:
results.writelines(i+","+j+"\n"+","+str(jaccard))
for i in products_list1:should readfor i in products_list1.readlines():to get an actual list to loop over