def title_word_cloud():
"""
???????
"""
text = ''
wc = WordCloud(background_color='white', # ??????
stopwords=STOPWORDS,
max_words=1000, # ?????????
font_path='C:/Python27/Lib/site-packages/matplotlib/mpl-data/fonts/ttf/simhei.ttf',
# ?????????????????
max_font_size=50, # ???????
random_state=30, # ??????????????????????
)
with open('rent_ave.csv') as csvfile:
reader = [each for each in csv.DictReader(csvfile)]
for row in reader:
text += row[u'title'] + ' '
print jieba_clear_text(text)
wc.generate(jieba_clear_text(text))
plt.imshow(wc)
plt.axis('off')
plt.show()
评论列表
文章目录