Created
July 3, 2019 10:38
-
-
Save fclesio/97de0b621fed6caa2df4332ed8d11e55 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
# Convert the lyrics to string to not break the posterior converts | |
df_raw_lyrics['lyric'] = df_raw_lyrics['lyric'].astype(str) | |
# Remove all stopwords | |
df_raw_lyrics['lyric'] = df_raw_lyrics['lyric']\ | |
.apply(lambda x: ' '.join([item for item in x.lower()\ | |
.split() if item not in stoplist])) | |
# Quick check | |
df_raw_lyrics.head(5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment