Skip to content

Instantly share code, notes, and snippets.

@tiaplagata
Created January 27, 2021 20:06
Show Gist options
  • Save tiaplagata/191244194d84bdab70992f697c10ab66 to your computer and use it in GitHub Desktop.
Save tiaplagata/191244194d84bdab70992f697c10ab66 to your computer and use it in GitHub Desktop.
# Store our document term matrix data for Rome
data = dtm.transpose()['Rome, Italy'].sort_values(ascending=False)
# Generate the word cloud from frequencies
wc = WordCloud().generate_from_frequencies(data)
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