2022-10-01

python wordcloud stopwords

파이썬 워드 클라우드 stopwords

python wordcloud


#Python_(programming_language)

import wikipedia
import matplotlib.pyplot as plt

wiki=wikipedia.page('Python_(programming_language)')
text=wiki.content

from wordcloud import WordCloud, STOPWORDS
s_words=STOPWORDS.union({'used','use','many'})
wc=WordCloud(width=1000, height=700, stopwords=s_words).generate(text)

plt.figure(figsize=(40,40))
plt.imshow(wc)
plt.show()

댓글 없음:

댓글 쓰기