from matplotlib import pyplot as plt from wordcloud import WordCloud词云显示font = rSTCAIYUNTTF wc = WordCloudfontpath=font backgroundcolor=whitewidth=1000 height=800generate joinnew_data pltimshowwc plta
这个错误可能是因为WordCloud库的版本问题。建议尝试升级WordCloud库,或者使用其他版本的库。同时,也可以在生成词云时尝试加入stopwords参数,过滤一些常用词语,减少可能出现的错误。例如:
wc = WordCloud(fontpath=font, backgroundcolor="white",width=1000, height=800, stopwords={"the", "and", "of"}).generate(" ".join(new_data))
原文地址: https://www.cveoy.top/t/topic/g5R9 著作权归作者所有。请勿转载和采集!