Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate_from_frequencies no longer working #766

Open
Dmonzer opened this issue Jun 5, 2024 · 1 comment
Open

generate_from_frequencies no longer working #766

Dmonzer opened this issue Jun 5, 2024 · 1 comment

Comments

@Dmonzer
Copy link

Dmonzer commented Jun 5, 2024

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()


#### Versions
<!--
Please run the following snippet and paste the output below.
import platform; print(platform.platform())
import sys; print("Python", sys.version)
import numpy; print("NumPy", numpy.__version__)
import matplotlib; print("matplotlib", matplotlib.__version__)
import wordcloud; print("wordcoud", wordcloud.__version__)
-->
Windows-10-10.0
Python 3.7.8 | packaged by conda-forge |
NumPy 1.21.6
matplotlib 3.5.3
wordcoud 1.9.3

<!-- Thanks for contributing! -->
@welpo
Copy link

welpo commented Jun 18, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants