Code Monkey home page Code Monkey logo

Comments (5)

amueller avatar amueller commented on August 22, 2024 1

you are not instantiating a WordCloud object. Somewhere there should be wordcloud = WordCloud()

from word_cloud.

amueller avatar amueller commented on August 22, 2024

Did you import it?

from word_cloud.

melvinwevers avatar melvinwevers commented on August 22, 2024

Yes.
Installed it and imported it.

On Wed 25 Mar 2015 at 19:39 Andreas Mueller [email protected]
wrote:

Did you import it?


Reply to this email directly or view it on GitHub
#50 (comment).

from word_cloud.

amueller avatar amueller commented on August 22, 2024

can you give the exact code please?

from word_cloud.

melvinwevers avatar melvinwevers commented on August 22, 2024

from os import path
import matplotlib.pyplot as plt
from wordcloud import WordCloud

final_topics = open("yourfile.txt")

curr_topic = 0
for line in final_topics:
#line = line.strip()[line.rindex("'") + 2:]
scores = [float(x.split("")[0]) for x in line.split(" + ")]
words = [x.split("
")[1] for x in line.split(" + ")]
freqs = []
wordcloud.fit_words

print(words)

for word, score in zip(words, scores):
    freqs.append((word, score))
elements = wordcloud.fit_words(freqs, width=120, height=120)
wordcloud.draw(elements, "gs_topic_%d.png" % (curr_topic),
               width=120, height=120)
curr_topic += 1

final_topics.close()

On 26 Mar 2015, at 15:48, Andreas Mueller [email protected] wrote:

can you give the exact code please?


Reply to this email directly or view it on GitHub #50 (comment).

from word_cloud.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.