TheRestDevelop
.txt를 wordcloud파일로 저장하기
void
2018. 6. 26. 10:00
from wordcloud import WordCloudfrom os import path
def wordCloud(self):
# Read the whole text.
text = open(path.join(FILE_PATH, '파일명.txt')).read()
# Generate a word cloud image
wordcloud = WordCloud().generate(text)
import matplotlib.pyplot as pltplt.figure()
plt.imshow(wordcloud, interpolation="bilinear")
plt.axis("off")
plt.show()