Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Using the fuzzywuzzy package to calculate the distance between 2 strings
### Using the fuzzywuzzy package
fuzzywuzzy package in python implements the Lavenshtein distance between two string to calculate the similarity between the two.
Install 2 packages:
pip install fuzzywuzzy
pip install python-Levenshtein / conda install -c conda-forge python-levenshtein
`[I actually had an issue installing the package, so I used the conda installation for this this package]`
This package is required to suppress the warning for the default slow fuzzywuzzy package.
It apparently works well with python-levenshtein package.
We can use many powerful functions in the python-levenshtein package like the
- *ratio*,
- *partial_ratio*,
- *token_sort_ratio*,
- *token_set_ratio*.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment