'DataFrame' object has no attribute 'ix'
Hi there,
I ran the following command. vcontact --raw-proteins AVi/AVi_genomes.faa --rel-mode Diamond --proteins-fp AVi/AVi_genomes_g2g.csv --db 'ArchaeaViralRefSeq97-Merged' --pcs-mode MCL --vcs-mode MCL --c1-bin /home/david/miniconda2/envs/vContact2/bin/cluster_one-1.0.jar --output-dir vConTACT2_Results
I got following errors. BTW, the version is 0.9.13.
ERROR:vcontact2: Error in contig clustering ERROR:vcontact2: 'DataFrame' object has no attribute 'ix' Traceback (most recent call last): File "./bin/vcontact", line 607, in main gc = vcontact.contig_clusters.ContigCluster(pcp, output_dir, cluster_one_fp, cluster_one_args, File "/home/alex/miniconda2/envs/vContact2/lib/python3.8/site-packages/vcontact/contig_clusters.py", line 102, in init self.matrix["B"] = matrices.bool_membership(self.contigs) File "/home/alex/miniconda2/envs/vContact2/lib/python3.8/site-packages/vcontact/matrices.py", line 70, in bool_membership xy = contigs.reset_index().ix[:, ["pos", "pos_cluster"]].dropna(subset=["pos_cluster"]).values # pos?, # membership File "/home/alex/miniconda2/envs/vContact2/lib/python3.8/site-packages/pandas/core/generic.py", line 5274, in getattr return object.getattribute(self, name)
Comments (8)
-
-
I am getting a very similar error with vConTACT2 0.9.15:
ERROR:vcontact2: Error in contig clustering ERROR:vcontact2: 'DataFrame' object has no attribute 'ix' Traceback (most recent call last): File "<path to vConTACT2 conda environment>/bin/vcontact", line 610, in main mode=args.vc_mode) File "<path to vConTACT2 conda environment>/lib/python3.7/site-packages/vcontact/contig_clusters.py", line 102, in __init__ self.matrix["B"] = matrices.bool_membership(self.contigs) File "<path to vConTACT2 conda environment>/lib/python3.7/site-packages/vcontact/matrices.py", line 70, in bool_membership xy = contigs.reset_index().ix[:, ["pos", "pos_cluster"]].dropna(subset=["pos_cluster"]).values # pos?, # membership File "<path to vConTACT2 conda environment>/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'
It is my first experience with installing software in a conda environment, so I thought that I might have made something wrong during installation. I have tried to install vConTACT2 0.9.12 instead of the latest version, to install from source using “pip install“ instead of “conda install“, but the error persists.
I would appreciate any advice on how to fix it!
Kind regards,
Anastasia -
UPDATE: Downgrading pandas to version 0.25.3 in the conda environment (conda install -y pandas=0.25.3) solved the problem for me.
Kind regards,
Anastasia -
Downgrading as Anastasia suggested worked for me, however, I get now an error at the last step:
ERROR:vcontact2: Error in exporting the final summary data: first argument must be string or compiled pattern
What would be the way to tackle that?
Regards,
Cynthia
-
Curious to know the answer to above, I am encountering the same error, mentioned in issue #3.
-
Downgrading pandas to version 0.25.3 worked for me. Thank you for posting the solution.
-
Hi All,
Apologies for the delay here. As several have pointed out, the main issue is with pandas, or specifically, the requirements specifying greater than pandas 0.21.0. The 1.x series is greater than, and thus fulfills the requirement, but it includes a breaking change when using .ix. A quick fix, as pointed out by Anastasia, is to downgrade your conda environment’s pandas version:
conda install pandas=0.25.3
You may need to activate your vContact2 conda environment beforehand, if you installed using Anaconda/Miniconda.
If installed using pip, try:
pip --force-reinstall pandas==0.25.3
I have already made the requisite changes to the setup/installation, and will be pushing an update to bitbucket (among other things) and bioconda over the next day. New installs using the updated code should no longer encounter this error.
-
- changed status to resolved
Fix implemented, i.e. specify maximum pandas version to 0.25.3.
If other errors occur, please open a new issue or (if it's another issue currently open) please add info there.
Thanks!
P.S. Bioconda will be updated to reflect this update.
- Log in to comment
Hello,
I am getting the same error mentioned.
I thought it was because of the pandas version (https://pandas.pydata.org/pandas-docs/version/1.0.0/whatsnew/v1.0.0.html#removal-of-prior-version-deprecations-changes)
So I did downgrade it to pandas==0.19.2, however, I still get the same error.