Created
June 4, 2021 10:20
-
-
Save AayushSameerShah/ce931f18bbcacdaa0c8fba40b059f980 to your computer and use it in GitHub Desktop.
Use re.sub to avoid yourself doing "string".replace().replace().replace()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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