I'm trying to compare the values in 2 dataframes. This is my code :
for i in df1['Searches']:
for j in df['Tags']:
if i == j:
print(i,j)
The code works. However, I want to account for cases where the strings don't entirely match, due to spacing, misspelling, or punctuation, but they should match given how much they have in common.
For instance:
Searches | Tags
----------------------------------
lightblue | light blue
light-blue | light blue
light blu | light blue
lite blue | light blue
liteblue | light blue
liteblu | light blue
light b l u e | light blue
light.blue | light blue
l i ght blue | light blue
I listed variations of possible strings that could show up under searches, and the string that it should match to under tags. Is there a way to account for those variations and still have them match?
Thank you for taking the time to read my question and help in any way you can.