Last active
November 7, 2021 23:57
-
-
Save tiaplagata/9b9e28103cffca7edd200039f5bf70c9 to your computer and use it in GitHub Desktop.
creating a basic word cloud from text corpus
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
#Give our Rome corpus a variable name | |
rome_corpus = df.lemmatized[10] | |
#Instantiate wordcloud object and use method to feed it our corpus | |
wc = WordCloud().generate_from_text(rome_corpus) | |
#Use matplotlib.pyplot to display the fitted wordcloud | |
#Turn axis off to get rid of axis numbers | |
plt.imshow(wc) | |
plt.axis('off') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment