Created
May 23, 2020 02:21
-
-
Save roshan-adusumilli/9b07ae570736bf88cc047cd7545d9f10 to your computer and use it in GitHub Desktop.
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
| nltk.download('stopwords') | |
| from nltk.corpus import stopwords | |
| stop_words = set(stopwords.words('english')) | |
| def remove_stopwords(tweet): | |
| tweet = [n for n in tweet if not n in stop_words] | |
| return tweet | |
| ca_df['tweet_text'] = ca_df['tweet_text'].apply(remove_stopwords) | |
| ny_df['tweet_text'] = ny_df['tweet_text'].apply(remove_stopwords) | |
| tx_df['tweet_text'] = tx_df['tweet_text'].apply(remove_stopwords) | |
| ca_df.head() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment