用于df.CUSTOMER_CONTENTION_TEXT.values中的行:在哪里可以用我的Excel文件找到它

问题描述 投票:0回答:1
import matplotlib.pyplot as plt
import pandas as pd
plt.style.use('ggplot')

from wordcloud import WordCloud, STOPWORDS

df = pd.read_excel(r'crawling.xlsx')

text = ''
for row in df.CUSTOMER_CONTENTION_TEXT.values:
    text = text + row.value() + ' '

wc = WordCloud(max_words=2000,
               stopwords=STOPWORDS, font_path=r'NanumBarunGothic.otf')
# generate word cloud
wc.generate(text)

# store to file
wc.to_file(r'first.png')

# show
plt.imshow(wc)
plt.axis("off")
plt.figure()
plt.axis("off")
plt.show()

我从github [https://gist.github.com/pybokeh/de5475328fb2bbb33cb7]python_wordcloud_from_excel.ipynb

用于df.CUSTOMER_CONTENTION_TEXT.values中的行:

我听不懂。你能解释一下吗?我想修复此代码并使用它,但我不知道如何解决。

python word-cloud
1个回答
0
投票

这是Excel中的第一行,列值。

© www.soinside.com 2019 - 2024. All rights reserved.