I’ve been stuck on this exercise for a week! I can’t seem to figure why i get
ValueError:The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Everytime I run the code. I’ve tried using the functions recommended by the message, but I keep getting the same error message.
An exception like that in python will point at a very specific line of code. As Tom says, that error typically means you have an “if” statement and the “condition” is a vector instead of a scalar. It needs to be a single value in order for the statement to make sense. So you need to understand what is going wrong and why your code produced a vector instead of a scalar at that point.