viralrecall icon indicating copy to clipboard operation
viralrecall copied to clipboard

Pandas treating booleans as ambiguous

Open cedricblais opened this issue 1 year ago • 2 comments

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

cedricblais avatar Nov 07 '23 16:11 cedricblais