Closed
Description
DataFrame
should behave consistently with Series
and NumPy arrays when used in boolean comparison. Additionally, should provide consistent all
/any
behaviour.
>>> from pandas import *
>>> s = Series([1, 2, 3])
>>> bool(s)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
>>> d = DataFrame([[1,2,3]])
>>> bool(d)
True # should throw ValueError as well
>>> all(s)
True
>>> all(d)
False # should be True