word_3.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:text_analysis 作者: mathlf2015 项目源码 文件源码
def get_wordclud(file_set):
    line_set = []
    for j in range(10):
        reader=csv.reader(open(file_set[j], 'r'))
        for line in reader:
            line_set.append(line[1])
    word_list = [" ".join(jieba.cut(sentence)) for sentence in line_set]
    new_text = ' '.join(word_list)
    wordcloud = WordCloud(font_path="C:/Python34/Lib/site-packages/wordcloud/simhei.ttf", background_color="black").generate(new_text)
    plt.imshow(wordcloud)
    plt.axis("off")
    plt.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号