Skip to content

Instantly share code, notes, and snippets.

@devamitranjan
Created December 15, 2020 17:29
Show Gist options
  • Save devamitranjan/ea08e17111b5cd98a89a170f0baaec05 to your computer and use it in GitHub Desktop.
Save devamitranjan/ea08e17111b5cd98a89a170f0baaec05 to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
from sklearn.feature_extraction import text
from wordcloud import WordCloud
def generate_word_clouds(df):
allWords = ' '.join([twts for twts in df['Comments']])
wordCloud = WordCloud(stopwords = text.ENGLISH_STOP_WORDS ,width=1000, height=600, random_state=21, max_font_size=110).generate(allWords)
plt.imshow(wordCloud, interpolation="bilinear")
plt.axis('off')
plt.show()
generate_word_clouds(df)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment