faylward / viralrecall

Detection of NCLDV signatures in 'omic data
33 stars 12 forks source link

AttributeError: 'DataFrame' object has no attribute 'ix' #3

Closed xijianfei closed 3 years ago

xijianfei commented 3 years ago

Hello, I am getting an error when trying to run viralrecall using the NCLDV database. The error is :

Traceback (most recent call last): File "viralrecall.py", line 523, in status = main() File "viralrecall.py", line 518, in main run_program(input, project, database, window, phagesize, minscore, minvog, evalue, cpus, plotflag, redo, flanking, batch, summary_file) File "viralrecall.py", line 335, in run_program subset = df3.ix[reg] File "/public/work/jianfei/soft/anaconda3/lib/python3.7/site-packages/pandas/core/generic.py", line 5274, in getattr return object.getattribute(self, name) AttributeError: 'DataFrame' object has no attribute 'ix'

I find that panda "ix" is deprecated, My panda version is pandas-1.0.5. Any idea could solve this problem?

Thank you,

JianFei

faylward commented 3 years ago

Other users have reported this issue when using older versions of Python. Perhaps create a different environment (preferably Python 3.5) and try again?

susutBu commented 3 years ago

This maybe the resulted by the different version of pandas. After 1.0.0, pandas removed the series.ix and dataframe.ix methods. So your can use the lower version of Pandas (lower than 1.0.0), or replace the ix method by iloc of the viralrecall.py

tylerdodgeball commented 3 years ago

I am getting a similar error with Python 3.7.8:

Traceback (most recent call last): File "viralrecall.py", line 725, in status = main() File "viralrecall.py", line 720, in main run_program(input, project, database, window, phagesize, minscore, minhit, evalue, cpus, plotflag, redo, flanking, batch, summary_file, contiglevel) File "viralrecall.py", line 521, in run_program subset = df3.ix[reg] File "/home/wtgibson/anaconda3/lib/python3.7/site-packages/pandas/core/generic.py", line 5274, in getattr return object.getattribute(self, name) AttributeError: 'DataFrame' object has no attribute 'ix'

faylward commented 3 years ago

I changed the ix syntax to iloc, so this should be compatible with python versions >3.6 now