Giter Club home page Giter Club logo

Comments (5)

JasonKessler avatar JasonKessler commented on May 17, 2024

I can't replicate this. How did you install the package?

Also, make sure that there's not file or folder named "scattertext.py" or "scattertext" in your working directory.

from scattertext.

shyamalschandra avatar shyamalschandra commented on May 17, 2024

I used pip.

Here is the error I am getting now that I removed the scattertext.pyc file from the cwd:

Traceback (most recent call last):
  File "stextt.py", line 13, in <module>
    filtered_term_doc_mat = (ST.TermDocMatrixFilter(pmi_threshold_coef = 3, min_freq = 10).filter(term_doc_mat))
TypeError: __init__() got an unexpected keyword argument 'min_freq'

I will look into the code later today. Thanks for responding so quickly!

from scattertext.

JasonKessler avatar JasonKessler commented on May 17, 2024

Ah. Looks like I forgot to update the param name in the example after changing it in a new version. I'll go ahead and change it, but use minimum_term_freq instead of min_freq.

from scattertext.

shyamalschandra avatar shyamalschandra commented on May 17, 2024

Okay, I changed the parameter name to minimum_term_freq instead of min_freq and reran the code and got the following error:

iMac:Desktop shyamalsuhanachandra$ python stextt.py 
Traceback (most recent call last):
  File "stextt.py", line 15, in <module>
    scatter_chart_data = (ST.ScatterChart(filtered_term_doc_mat).to_dict('text1', category_name='text1', not_category_name='text2')) 
  File "/usr/local/lib/python2.7/site-packages/scattertext/ScatterChart.py", line 61, in to_dict
    df = self._build_dataframe_for_drawing(all_categories, category, scores)
  File "/usr/local/lib/python2.7/site-packages/scattertext/ScatterChart.py", line 188, in _build_dataframe_for_drawing
    df[df[all_categories].sum(axis=1) > self.minimum_term_frequency],
  File "/usr/local/lib/python2.7/site-packages/pandas/core/frame.py", line 1991, in __getitem__
    return self._getitem_array(key)
  File "/usr/local/lib/python2.7/site-packages/pandas/core/frame.py", line 2035, in _getitem_array
    indexer = self.ix._convert_to_indexer(key, axis=1)
  File "/usr/local/lib/python2.7/site-packages/pandas/core/indexing.py", line 1214, in _convert_to_indexer
    raise KeyError('%s not in index' % objarr[mask])
KeyError: "['text1 freq'] not in index"

Any thoughts?

from scattertext.

shyamalschandra avatar shyamalschandra commented on May 17, 2024

I changed the names to text1 and text2 and it runs successfully.

from scattertext.

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.