Skip to content

Instantly share code, notes, and snippets.

@tiaplagata
Last active November 7, 2021 23:57
Show Gist options
  • Save tiaplagata/9b9e28103cffca7edd200039f5bf70c9 to your computer and use it in GitHub Desktop.
Save tiaplagata/9b9e28103cffca7edd200039f5bf70c9 to your computer and use it in GitHub Desktop.
creating a basic word cloud from text corpus
#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