Skip to content

Instantly share code, notes, and snippets.

@tchiavegatti
Created May 29, 2024 12:07
Show Gist options
  • Save tchiavegatti/7ce25c948d548d0e573ecbf7546768f7 to your computer and use it in GitHub Desktop.
Save tchiavegatti/7ce25c948d548d0e573ecbf7546768f7 to your computer and use it in GitHub Desktop.
Remove punctuation, accents and put into lower case
def strip_accents_and_lower(s):
return ''.join(c for c in unicodedata.normalize('NFD', s) if unicodedata.category(c) != 'Mn').lower()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment