cfdm.Data.any

Data.any()[source]

Test whether any data array elements evaluate to True.

Performs a logical or over the data array and returns the result. Masked values are considered as False during computation.

Returns
bool

True if any data array elements evaluate to True, otherwise False.

Examples

>>> d = cfdm.Data([[0, 0, 0]])
>>> d.any()
False
>>> d[0, 0] = cfdm.masked
>>> print(d.array)
[[-- 0 0]]
>>> d.any()
False
>>> d[0, 1] = 3
>>> print(d.array)
[[-- 3 0]]
>>> d.any()
True
>>> d[...] = cfdm.masked
>>> print(d.array)
[[-- -- --]]
>>> d.any()
False