I have a array of numpy arrays
[array([5, 5, 5]), array([6, 6, 6])]
However if I try to check if an object exists in that array
[5, 5, 5] in x
I get this error
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Is there any way to fix this? Or am I doing something wrong?
xa list orndarray? Ifndarrayhow did you create it? You get the ambiguity error becauseinis using an equality test, andan_array==somethingproduces a boolean array, many true/false values.alist==another_listproduces a simple True/False. That's not the case with arrays. So in generalinis a poor test when working with arrays.