Solve the wordcloud display Chinese as a space (blank)

Solution

Use font_paththis parameter to add the font library during initialization :

import wordcloud  # 词云展示库

# 。。。。。。

wc = wordcloud.WordCloud(
        background_color="white",
        font_path='/System/Library/Fonts/STHeiti Medium.ttc', # Mac上的中文字体库
    )

# 。。。。

Guess you like

Origin blog.csdn.net/weixin_35757704/article/details/113997928