Skip to content

Instantly share code, notes, and snippets.

@amankharwal
Created January 19, 2021 07:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amankharwal/8f3ad453d1e82f0e071f44846b9c953a to your computer and use it in GitHub Desktop.
Save amankharwal/8f3ad453d1e82f0e071f44846b9c953a to your computer and use it in GitHub Desktop.
stopwords = set(STOPWORDS)
words = ''
for review in df1.Review:
tokens = str(review).split()
tokens = [i.lower() for i in tokens]
words += ' '.join(tokens) + ' '
wordcloud = WordCloud(width = 800, height = 800,
background_color ='white',
stopwords = stopwords,
min_font_size = 10).generate(words)
# plot the WordCloud image
plt.figure(figsize = (8, 8), facecolor = None)
plt.imshow(wordcloud)
plt.axis("off")
plt.tight_layout(pad = 0)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment