# speaking of fuzzy matching...
from fuzzywuzzy import fuzz, process
SEARCH = 'Anthony'
CHOICES = ['Anth', 'Anthony', 'Anthony Y', 'Bob', 'Bobthony']
STRATS = [fuzz.partial_ratio, fuzz.ratio, fuzz.token_set_ratio]
for strat in STRATS:
print(f'Results for {strat.__name__}')
print(process.extract(SEARCH, CHOICES, scorer=strat), end='\n'*2)
Results for partial_ratio [('Anth', 100), ('Anthony', 100), ('Anthony Y', 100), ('Bobthony', 71), ('Bob', 33)] Results for ratio [('Anthony', 100), ('Anthony Y', 88), ('Anth', 73), ('Bobthony', 67), ('Bob', 20)] Results for token_set_ratio [('Anthony', 100), ('Anthony Y', 100), ('Anth', 73), ('Bobthony', 67), ('Bob', 20)]
!jupyter nbconvert --to html *.ipynb --output-dir="../../../static/notebooks"
[NbConvertApp] Converting notebook notes.ipynb to html [NbConvertApp] Writing 578087 bytes to ../../../static/notebooks/notes.html