Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created April 9, 2021 09:26
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save amankharwal/57a3b1f2db11abbd7abe659c2786e093 to your computer and use it in GitHub Desktop.
l = ["Aman Kharwal", "Sapna"]
for i in range(len(l)):
dummy_df = messages_df[messages_df['Author'] == l[i]]
text = " ".join(review for review in dummy_df.Message)
stopwords = set(STOPWORDS)
#Generate a word cloud image
print('Author name',l[i])
wordcloud = WordCloud(stopwords=stopwords, background_color="white").generate(text)
#Display the generated image
plt.figure( figsize=(10,5))
plt.imshow(wordcloud, interpolation='bilinear')
plt.axis("off")
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment