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

pyLDAvis drop() takes from 1 to 2 positional arguments but 3 were given #247

Closed
unusualpyp opened this issue Apr 13, 2023 · 11 comments
Closed
Assignees

Comments

@unusualpyp
Copy link

image
Excuse me, how to solve this problem?

@unusualpyp
Copy link
Author

Whether it is version 2.12.2 or version 3.4.0, it is the same.

@alee2233
Copy link

This is an issue if you use the latest Pandas (currently 2.0.0). If you downgrade to 1.5.3 it will work fine, just gives this warning:

/opt/conda/lib/python3.10/site-packages/pyLDAvis/_prepare.py:244: FutureWarning: In a future version of pandas all arguments of DataFrame.drop except for the argument 'labels' will be keyword-only.
  by='saliency', ascending=False).head(R).drop('saliency', 1)

This should be fixed in _prepare.py with the solution here: https://stackoverflow.com/questions/75997054/trying-to-visualize-topics-using-pyldavis-but-it-is-giving-drop-error

@msusol msusol self-assigned this Apr 14, 2023
@sguo28
Copy link

sguo28 commented Apr 17, 2023

This is an issue if you use the latest Pandas (currently 2.0.0). If you downgrade to 1.5.3 it will work fine, just gives this warning:

/opt/conda/lib/python3.10/site-packages/pyLDAvis/_prepare.py:244: FutureWarning: In a future version of pandas all arguments of DataFrame.drop except for the argument 'labels' will be keyword-only.
  by='saliency', ascending=False).head(R).drop('saliency', 1)

This should be fixed in _prepare.py with the solution here: https://stackoverflow.com/questions/75997054/trying-to-visualize-topics-using-pyldavis-but-it-is-giving-drop-error

I solved it following the link. Thank you.

@msusol
Copy link
Collaborator

msusol commented Apr 21, 2023

I can not reproduce the error with pyLDAvis 3.4.0, pandas 2.0.0, python 3.11.3 even with .drop('saliency', 1)

import pyLDAvis.gensim_models

pyLDAvis.enable_notebook()
vis = pyLDAvis.gensim_models.prepare(lda, corpus, dictionary)
pyLDAvis.show(vis, local=False)

@msusol msusol closed this as completed Apr 21, 2023
@rhnprabhune
Copy link

image

with python 3.9.16 version.
Am I missing something here ? Thank you

@bsherin
Copy link

bsherin commented Apr 23, 2023

I'm getting this error too with pyLDAvis 3.4.0, pandas 2.0.0, python 3.11.3. I only started getting this error when I updated to python 3.11.

@msusol msusol reopened this Apr 23, 2023
@msusol
Copy link
Collaborator

msusol commented Apr 23, 2023

Please try v.3.4.1
https://github.com/bmabey/pyLDAvis/releases/tag/3.4.1

@bsherin
Copy link

bsherin commented Apr 24, 2023

Upgrading to 3.4.1 did the trick. Thanks!

@huni1023
Copy link

Ah.. In my case, I cannot avoid issue through updating package. Because my python version is 3.8.16 (**pyLDAvis 3.4.1 requires Python version above 3.9)

Does anyone solve this issue in python3.8 ?

*Python = 3.8.16
*Pandas = 2.0.1
*pyLDAvis = 3.4.0

@miguelcferreira
Copy link

Yup same here, while learning to code, had same error...

Python=3.11.5
Pandas=2.1.1
(hope this correct) - noob mode activated

with a simple drop term to delete columns and rows!

via Jupyter

TypeError: DataFrame.drop() takes from 1 to 2 positional arguments but 3 were given

@Freddy1980Unal
Copy link

Freddy1980Unal commented Nov 6, 2023

Buenas tardes, cómo puedo solucionar esta situación, muchas gracias
TypeError: DataFrame.drop() takes from 1 to 2 positional arguments but 3 were given

python

@msusol msusol unpinned this issue Dec 14, 2023
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

9 participants