faylward / viralrecall

Detection of NCLDV signatures in 'omic data
30 stars 11 forks source link

Pandas treating booleans as ambiguous #22

Open cedricblais opened 8 months ago

cedricblais commented 8 months ago

Hello,

I recently tried running a local install of viralrecall. However, I got the following error message:

Traceback (most recent call last):
  File "viralrecall.py", line 733, in <module>
    status = main()
  File "viralrecall.py", line 728, in main
    run_program(input, project, database, window, phagesize, minscore, minhit, evalue, cpus, plotflag, redo, flanking, batch, summary_file, contiglevel)
  File "viralrecall.py", line 655, in run_program
    plt.ylim(minval, numpy.nanmax(df2["rolling"]))
  File "/scratch2/software/anaconda/envs/viralrecall-preq/lib/python3.5/site-packages/matplotlib/pyplot.py", line 1478, in ylim
    ret = ax.set_ylim(*args, **kwargs)
  File "/scratch2/software/anaconda/envs/viralrecall-preq/lib/python3.5/site-packages/matplotlib/axes/_base.py", line 3470, in set_ylim
    if bottom == top:
  File "/scratch2/software/anaconda/envs/viralrecall-preq/lib/python3.5/site-packages/pandas/core/generic.py", line 1576, in __nonzero__
    .format(self.__class__.__name__))
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

My understanding is that this is due to pandas treating booleans as ambiguous. I was wondering if there is a simple way to resolve this issue?

Thank you! Cédric

faylward commented 8 months ago

Have you tried switching python environments and versions? Frank

On Tue, Nov 7, 2023, 11:15 AM cedricblais @.***> wrote:

Hello,

I recently tried running a local install of viralrecall. However, I got the following error message:

Traceback (most recent call last): File "viralrecall.py", line 733, in status = main() File "viralrecall.py", line 728, in main run_program(input, project, database, window, phagesize, minscore, minhit, evalue, cpus, plotflag, redo, flanking, batch, summary_file, contiglevel) File "viralrecall.py", line 655, in run_program plt.ylim(minval, numpy.nanmax(df2["rolling"])) File "/scratch2/software/anaconda/envs/viralrecall-preq/lib/python3.5/site-packages/matplotlib/pyplot.py", line 1478, in ylim ret = ax.set_ylim(*args, **kwargs) File "/scratch2/software/anaconda/envs/viralrecall-preq/lib/python3.5/site-packages/matplotlib/axes/_base.py", line 3470, in set_ylim if bottom == top: File "/scratch2/software/anaconda/envs/viralrecall-preq/lib/python3.5/site-packages/pandas/core/generic.py", line 1576, in nonzero .format(self.class.name)) ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

My understanding is that this is due to pandas treating booleans as ambiguous. I was wondering if there is a simple way to resolve this issue?

Thank you! Cédric

— Reply to this email directly, view it on GitHub https://github.com/faylward/viralrecall/issues/22, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACPFN7SNENIW3GXAVGJIGFDYDJNCPAVCNFSM6AAAAAA7BOQNCKVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE4DCNZSHA4TQMQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

cedricblais commented 8 months ago

After experimenting with a handful of python environments I was able to find one that works, thank you for your help!