LDA visualization [ import_optional_dependency() got an unexpected keyword argument 'errors' ]

Viewed 1447

i got a error message while visualizing LDA model

import pyLDAvis
import pyLDAvis.gensim_models

pyLDAvis.enable_notebook()

vis = pyLDAvis.gensim_models.prepare(ldamodel,corpus, dictionary)
vis

and it gives me error message " import_optional_dependency() got an unexpected keyword argument 'errors'"

1 Answers

I've got the same error. The older version of import_optional_dependency() doesn't have the argument 'error'.

Check your pandas version :

import pandas as pd
print(pd.__version__)

If your version is less than 1.3, install the updated version :

!pip install pandas==1.3.1

or

!pip install pandas --upgrade

That worked for me.

Related