AttributeError: 'DataFrame' object has no attribute 'append'

Issue #61 closed
shailesh nair created an issue

I am on iphop v.1.10 installed through conda. When I run the command

iphop predict --fa_file vcontigs.fasta \
--db_dir /home/database/iphoh/Sept_2021_pub/ \
--out_dir host_predict \
-t 30 --no_qc

I get the following error:

Link matching genomes to representatives and filter out redundant / useless matches...
        Filtering blast data
Traceback (most recent call last):
  File "/home/miniconda3/envs/iphop/bin/iphop", line 10, in <module>
    sys.exit(cli())
  File "/home/miniconda3/envs/iphop/lib/python3.8/site-packages/iphop/iphop.py", line 121, in cli
    args["func"](args)
  File "/home/miniconda3/envs/iphop/lib/python3.8/site-packages/iphop/modules/master_predict.py", line 94, in main
    dataprep.aggregate(args)
  File "/home/miniconda3/envs/iphop/lib/python3.8/site-packages/iphop/modules/dataprep.py", line 40, in aggregate
    store_filtered = filter_hits(args,store,store_filtered,host_info)
  File "/home/miniconda3/envs/iphop/lib/python3.8/site-packages/iphop/modules/dataprep.py", line 213, in filter_hits
    store_filtered = store_filtered.append(df) ## Append should work directly now that we have matched all column and names nicely
  File "/home/.local/lib/python3.8/site-packages/pandas/core/generic.py", line 5989, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'append'

seems something to with the pandas package. My panadas version=1.3.2

Comments (4)

  1. Simon Roux repo owner

    Hi,

    “'DataFrame' object has no attribute 'append'“ is an error that (should) only appear in pandas 2.0. Can you double-check that iPhoP is really running with pandas 1.3.2 ?

  2. shailesh nair reporter

    You are right. The conda list shows pandas v.1.3.2 but Python is using v.2.0.1. Probably by mistake we installed two versions of pandas through conda and pip. After the removal of the pip version, the iphop is working fine.

    Thanks

  3. Log in to comment