You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not able to reproduce the error using the https://github.com/bmabey/pyLDAvis/blob/master/notebooks/Gensim%20Newsgroup.ipynb notebook with the following codeblock (lda -> ldamodel)
excuse me, can i solve this??
pyLDAvis.enable_notebook() vis = pyLDAvis.gensim_models.prepare(ldamodel, corpus, dictionary) pyLDAvis.display(vis)
and the error got like this👇
TypeError Traceback (most recent call last)
/var/folders/_t/3y_grysj66102pr90s1sgnkh0000gn/T/ipykernel_23220/4280233777.py in ?()
1 pyLDAvis.enable_notebook()
2 vis = pyLDAvis.gensim_models.prepare(ldamodel, corpus, dictionary)
----> 3 pyLDAvis.display(vis)
/opt/anaconda3/lib/python3.11/site-packages/pyLDAvis/_display.py in ?(data, local, **kwargs)
218 warnings.warn(
219 "display: specified urls are ignored when local=True")
220 kwargs['d3_url'], kwargs['ldavis_url'], kwargs['ldavis_css_url'] = write_ipynb_local_js()
221
--> 222 return HTML(prepared_data_to_html(data, **kwargs))
/opt/anaconda3/lib/python3.11/site-packages/pyLDAvis/_display.py in ?(data, d3_url, ldavis_url, ldavis_css_url, template_type, visid, use_http)
173 return template.render(visid=json.dumps(visid),
174 visid_raw=visid,
175 d3_url=d3_url,
176 ldavis_url=ldavis_url,
--> 177 vis_json=data.to_json(),
178 ldavis_css_url=ldavis_css_url)
/opt/anaconda3/lib/python3.11/site-packages/pyLDAvis/_prepare.py in ?(self)
463 def to_json(self):
--> 464 return json.dumps(self.to_dict(), cls=NumPyEncoder)
/opt/anaconda3/lib/python3.11/site-packages/pyLDAvis/_prepare.py in ?(self)
454 def to_dict(self):
--> 455 return {'mdsDat': self.topic_coordinates.to_dict(orient='list'),
456 'tinfo': self.topic_info.to_dict(orient='list'),
457 'token.table': self.token_table.to_dict(orient='list'),
458 'R': self.R,
/opt/anaconda3/lib/python3.11/site-packages/pandas/core/frame.py in ?(self, orient, into, index)
2035 UserWarning,
2036 stacklevel=find_stack_level(),
2037 )
2038 # GH16122
-> 2039 into_c = com.standardize_mapping(into)
2040
2041 # error: Incompatible types in assignment (expression has type "str",
2042 # variable has type "Literal['dict', 'list', 'series', 'split', 'tight',
TypeError: to_dict() takes from 1 to 2 positional arguments but 4 were given
i tried every version
The text was updated successfully, but these errors were encountered: