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

Textrank example fails: 'numpy.ndarray' object has no attribute 'loc' #133

Open
freddyheppell opened this issue Aug 25, 2023 · 0 comments
Open

Comments

@freddyheppell
Copy link

freddyheppell commented Aug 25, 2023

Thank you for submitting a bug report!

Steps to Reproduce

Run the demo_pytextrank.py file. It will crash with:

   '<b>%s</b> TextRank score rank: %s/%s' % (cat, term_ranks.loc[term, cat], corpus.get_num_metadata())
AttributeError: 'numpy.ndarray' object has no attribute 'loc'

This appears to be due to a mistake in the code (or some change in a library that's broken it), as term_ranks is a numpy array, not a Pandas dataframe.

Expected behavior

The example should run.

Environment

  • Scattertext version (e.g., 0.0.2.75): 0.1.19
  • Have I tried running this on the latest version of Scattertext? N/A, is latest version
  • OS (e.g., Linux): macOS
  • How you installed Scattertext (conda, pip, source): Pip
  • Build command you used (if compiling from source): N/A
  • Python version: 3.9.16
  • Version of dependencies: Numpy 1.25.2, Pandas 2.0.3, pytextrank 3.2.5
  • Any other relevant information:

Additional context

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

1 participant