turicreate.SArray.all

SArray.all()

Return True if every element of the SArray evaluates to True. For numeric SArrays zeros and missing values (None) evaluate to False, while all non-zero, non-missing values evaluate to True. For string, list, and dictionary SArrays, empty values (zero length strings, lists or dictionaries) or missing values (None) evaluate to False. All other values evaluate to True.

Returns True on an empty SArray.

Returns:
out : bool

See also

any

Examples

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