Truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()
The or and and python statements require truth-values. For pandas these are considered ambiguous so you should use “bitwise” | (or) or & (and) operations: These are overloaded for these kind of datastructures to yield the element-wise or (or and). Just to add some more explanation to this statement: The exception is thrown when you want to get the bool of a pandas.Series: What you hit was a place where the operator implicitly converted … Read more