Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

'numpy.ndarray' object has no attribute 'getA1' #175

Open
pzq25 opened this issue Sep 17, 2020 · 1 comment
Open

'numpy.ndarray' object has no attribute 'getA1' #175

pzq25 opened this issue Sep 17, 2020 · 1 comment

Comments

@pzq25
Copy link

pzq25 commented Sep 17, 2020

pyLDAvis.sklearn.prepare error

@evertorres
Copy link

evertorres commented Apr 29, 2024

changed this two lines in lda_model.py. Seems working

## https://numpy.org/doc/stable/reference/generated/numpy.matrix.getA1.html
def _get_doc_lengths(dtm):
#   return dtm.sum(axis=1).getA1()
    return dtm.sum(axis=1).ravel()

def _get_term_freqs(dtm):
   #return dtm.sum(axis=0).getA1()
    return dtm.sum(axis=0).ravel()

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants