Skip to content

Instantly share code, notes, and snippets.

@Nithilaa
Last active June 10, 2021 03:32
Show Gist options
  • Save Nithilaa/16615aec5f12b36897ea363d6e59d619 to your computer and use it in GitHub Desktop.
Save Nithilaa/16615aec5f12b36897ea363d6e59d619 to your computer and use it in GitHub Desktop.
Remove all punctuations and Unicode
%time df2['Review_Processed'] = df2['Review_Processed'].map(lambda x : re.sub(r'[^\x00-\x7F]+',' ', x))
%time df2['Review_Processed'] = df2['Review_Processed'].map(lambda x: re.sub(r'[^\w\s]', '', x))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment