Open Dmonzer opened 1 month ago
Did you figure this out?
generate_from_frequencies
works without issues for me. I'm using a Counter
from collections
.
Might be related to the specific versions I'm using. If it helps:
Python 3.12.3
NumPy 1.26.4
matplotlib 3.8.4
wordcoud 1.9.3
Description
worldcloud.generate_from_frequencies is creating this error: OSError: cannot open resource
I ran the exact same code below 1 month ago and it worked fine. For some reason, it is not working anymore. Code: ''' from wordcloud import WordCloud import matplotlib.pyplot as plt import pandas as pd
word_counts = df_weather['WEATHERNAME'].value_counts().to_dict() wordcloud = WordCloud(width=800, height=400, background_color='white') wordcloud.generate_from_frequencies(word_counts) plt.figure(figsize=(10, 5)) plt.imshow(wordcloud, interpolation='bilinear') plt.axis('off') # Hide axes plt.title('Weather Condition Occurrences') plt.show()