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

AttributeError: 'DataFrame' object has no attribute 'append'. Did you mean: '_append'? #53

Open
ltgmri opened this issue Apr 10, 2024 · 2 comments

Comments

@ltgmri
Copy link

ltgmri commented Apr 10, 2024

when I use the test data Melissa_full.csv to run the code, the below error appear.

AttributeError: 'DataFrame' object has no attribute 'append'. Did you mean: '_append'?

how do i fixed it. thank you

@LiuCanidk
Copy link

It is because the pandas version. Newer version of pandas deleted the attribute "append". So I recommend you to try two fixing ways:

  • try to downgrade the pandas version. That is: conda/mamba remove pandas, and then conda/mamba install -y pandas==1.2.0. This failed for me again with the same attribute error.
  • try to change the source code with new attribute pandas.concat. The error message must give you the information of where the error occur, for me it was "/work/share/acuwbf4fll/liucan/software/scFEA/src/scFEA.py", line 172", so vi /work/share/acuwbf4fll/liucan/software/scFEA/src/scFEA.py, and change the source code. That is,
    - source code: geneExprDf = geneExprDf.append(temp, ignore_index = True, sort=False)
    - change to: geneExprDf=pd.concat([geneExprDf, temp], ignore_index=True, sort=False)
    The second worked for me. Hope it helps.

@ltgmri
Copy link
Author

ltgmri commented Apr 11, 2024

Thanks to LiuCanidk. The second solution solved this error.

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

2 participants