turicreate.SArray.any

SArray.any()

Return True if any element of the SArray evaluates to True. For numeric SArrays any non-zero value evaluates to True. For string, list, and dictionary SArrays, any element of non-zero length evaluates to True.

Returns False on an empty SArray.

Returns:
out : bool

See also

all

Examples

>>> turicreate.SArray([1, None]).any()
True
>>> turicreate.SArray([1, 0]).any()
True
>>> turicreate.SArray([0, 0]).any()
False
>>> turicreate.SArray(["hello", "world"]).any()
True
>>> turicreate.SArray(["hello", ""]).any()
True
>>> turicreate.SArray(["", ""]).any()
False
>>> turicreate.SArray([]).any()
False