Created
December 15, 2020 08:08
-
-
Save wandabwa2004/b11ea6289179227f3dfd2d28c5b1b07d to your computer and use it in GitHub Desktop.
This file contains 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
#A little clean up | |
df_final_copy['tweet'] = df_final_copy['tweet'].map(lambda x:re.sub('[^a-zA-Z]',' ',str(x))) | |
#remove links or anything starting with http | |
df_final_copy['tweet'] = df_final_copy['tweet'].map(lambda x:re.sub('http.*','',str(x))) | |
#remove hashtags | |
df_final_copy['tweet'] = df_final_copy['tweet'].map(lambda x:re.sub(r'#','',str(x))) | |
df_final_copy['tweet'] = df_final_copy['tweet'].map(lambda x:re.sub(r'@\w*','',str(x))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment