Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from string import punctuation
- def remove_punct(text):
- text = ' '.join(word.strip(punctuation) for word in text.split() if word.strip(punctuation))
- return text
- data['Text'] = np.vectorize(remove_punct)(data['Text'])
- def remove_u(text):
- text = text.replace('_','')
- return text
- data['Text'] = np.vectorize(remove_u)(data['Text'])
Add Comment
Please, Sign In to add comment