I have a pandas data frame with two columns containing strings, like below:
Col-1 Col-2
Animal have an apple
Fruit tiger safari
Veg Vegetable Market
Flower Garden
From this i have to create a function which takes a string as argument.
This function then checks the fuzziwuzzy
similarity between the input string and the elements of Col-2
and outputs the elements of Col-1
and Col-2
corresponding of the highest computed similarity.
For instance suppose input string is Gardening Hobby
, here it will check similarity with all the elements of df['Col-2']
. The function finds this ways that Garden
as the highest similarity with Gardening Hobby
with a score of 90. Then Expected output is:
I/P O/P
Gardening Hobby Garden(60),Flower