Python - WordCloud
Hello following is my code where I am trying to generated wordcloud of a sample text, but I am facing an attribute error. Can someone help me with that? Thanks >> CODE >> with open("/home/sahil/worldcloud.txt") as f: count = dict() for line in f: words = line.split() for word in words: if word.isalpha(): if word in count: count[word] += 1 else: count[word] = 1 cloud = count.WordCloud() cloud.generate_from_frequencies(frequencies) cloud.to_file("myfile.jpg") << ENCODE << **ERROR Traceback (most recent call last): File "/usr/lib/python3.8/idlelib/run.py", line 559, in runcode exec(code, self.locals) File "/home/sahil/wordcloud.py", line 11, in <module> cloud = count.WordCloud() AttributeError: 'dict' object has no attribute 'WordCloud' **