Use a.any or a.all in code line

8 views
Skip to first unread message

Viswanath Vittaladevaram

unread,
Jun 13, 2022, 10:06:55 AM6/13/22
to mdnalysis-...@googlegroups.com
Hi,

I am doing md analysis and when I try to use the following command below, I get this error.

python plot_res-z.py -i fnIII-12_SAMch3.res-z -o fnIII-12_SAMch3_res-z.png --nres 92 --nreslabelskip 20 --tlabelskip 2500


Error:

File "plot_res-z.py", line 99, in <module>

    zmin=numpy.floor(min(res_z))

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()



Could you please help me how to fix this?


Regards,

Viswanath.V

Oliver Beckstein

unread,
Jun 13, 2022, 12:15:53 PM6/13/22
to mdnalysis-discussion
Hello Viswanath.V,

The plot_res-z.py is not part of MDAnalysis so my comment is just general: this looks like a Python/NumPy issue. You have to fix the code in the script. For a start, find out what “res_z” contains. Then try the commands interactively. Find out exactly which part of the code produces the error: is it min(res_z) or is it the floor function — or is it something else.

Oliver
--
Oliver Beckstein (he/his/him)

email: orbe...@mdanalysis.org
twitter: @orbeckst
GitHub: @orbeckst

MDAnalysis – a NumFOCUS fiscally sponsored project
https://www.mdanalysis.org/






Viswanath Vittaladevaram

unread,
Jun 13, 2022, 12:18:29 PM6/13/22
to mdnalysis-...@googlegroups.com
Hi,
it is related to min(res-z)

Thanks,
Viswanath.V

--
You received this message because you are subscribed to the Google Groups "MDnalysis discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mdnalysis-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mdnalysis-discussion/FF9D9200-509A-4BEB-9DA6-8809ECAA086B%40mdanalysis.org.
Reply all
Reply to author
Forward
0 new messages