You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there is a multiline text as a key in the dictionary, wordcloud.WordCloud().generate_from_frequencies(my_dict) is producing an error.
Seems this is due to the anchor value of wordcloud is not supported in PIL
Steps/Code to Reproduce
import wordcloud
This will work: wc = wordcloud.WordCloud().generate_from_frequencies({'a': 3, 'b': 1, 'c': 8})
This produces an error: wc = wordcloud.WordCloud().generate_from_frequencies({'a\n': 3, 'b': 1, 'c': 8})
What is the expected result with newlines? I would imagine tokens not to include newlines. generate_from_frequencies is meant as a more low-level interface with already parsed tokens. We could provide a more instructive error message but I would say that for that interface, removing newlines is in the users responsibility.
@amueller The expected result with the new lines can be printing the word as it is including the line separation. If adding that functionality is more complex, we can provide a more constructive message that asks the user to remove newline characters.
Description
If there is a multiline text as a key in the dictionary, wordcloud.WordCloud().generate_from_frequencies(my_dict) is producing an error.
Seems this is due to the anchor value of wordcloud is not supported in PIL
Steps/Code to Reproduce
import wordcloud
This will work: wc = wordcloud.WordCloud().generate_from_frequencies({'a': 3, 'b': 1, 'c': 8})
This produces an error: wc = wordcloud.WordCloud().generate_from_frequencies({'a\n': 3, 'b': 1, 'c': 8})
Versions
Linux-6.2.0-36-generic-x86_64-with-glibc2.35
Python 3.11.3 (main, Apr 19 2023, 23:54:32) [GCC 11.2.0]
NumPy 1.23.5
matplotlib 3.8.0
wordcoud 1.9.2
pillow 10.1.0
The text was updated successfully, but these errors were encountered: