We're a place where coders share, stay up-to-date and grow their careers.
string matching could be another way to compare the names:
from difflib import SequenceMatcher as SM a, b = 'Eugene Onegin', 'Eugene Oregon' acceptableRatio = (len(a) - 2) / len(a) acceptableRatio Out[4]: 0.8461538461538461 SM(None, a, b).ratio() Out[5]: 0.8461538461538461
from difflib import SequenceMatcher as SM
a, b = 'Eugene Onegin', 'Eugene Oregon'
acceptableRatio = (len(a) - 2) / len(a)
acceptableRatio Out[4]: 0.8461538461538461
SM(None, a, b).ratio() Out[5]: 0.8461538461538461
string matching could be another way to compare the names: