i have a dataframe as bellow
Int64Index: 14830 entries, 25791 to 10668
Data columns (total 2 columns):
word 14830 non-null object
coef 14830 non-null float64
dtypes: float64(1), object(1)
i try to make word cloud with coef as a frequency instead count
for ample
text = df['word']
WordCloud.generate_from_text(text)
TypeError: generate_from_text() missing 1 required positional argument: 'text'
or
text = np.array(df['word'])
WordCloud.generate_from_text(text)
TypeError: generate_from_text() missing 1 required positional argument: 'text'
How can i improve this code & made word cloud like this
from wordcloud import WordCloud
wordcloud = WordCloud( ranks_only= frequency).generate(text)
plt.imshow(wordcloud)
plt.axis('off')
plt.show()
thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…