cf.Data.all¶
-
Data.
all
()[source]¶ Test whether all data array elements evaluate to True.
Performs a logical
and
over the data array and returns the result. Masked values are considered as True during computation.- Returns
bool
Whether or not all data array elements evaluate to True.
Examples:
>>> d = cf.Data([[1, 3, 2]]) >>> print(d.array) [[1 3 2]] >>> d.all() True >>> d[0, 2] = cf.masked >>> print(d.array) [[1 3 --]] >>> d.all() True >>> d[0, 0] = 0 >>> print(d.array) [[0 3 --]] >>> d.all() False >>> d[...] = cf.masked >>> print(d.array) [[-- -- --]] >>> d.all() True