Here is example:
df = pd.DataFrame({
'link': ['link1', 'link1', 'link2', 'link2', 'link3', 'link3'],
'text': ['text1', 'text2', 'text3', 'text4', 'text5', 'text6']
})
I have a function (Levenshtein distance) which i would apply to each unique link and get result like this:
link text
0 link1 text1 text2 function(text1, text2) result
1 link2 text3 text4 function(text1, text2) result
2 link3 text5 text6 function(text1, text2) result