Skip to content

Instantly share code, notes, and snippets.

@AayushSameerShah
Created June 4, 2021 10:20
Show Gist options
  • Save AayushSameerShah/ce931f18bbcacdaa0c8fba40b059f980 to your computer and use it in GitHub Desktop.
Save AayushSameerShah/ce931f18bbcacdaa0c8fba40b059f980 to your computer and use it in GitHub Desktop.
Use re.sub to avoid yourself doing "string".replace().replace().replace()
import re
def remove(str_):
return re.sub(pattern, '', str_)
df.column.apply(remove)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment