scipp.any#

scipp.any(x, dim=None)#

Logical OR over input values.

Parameters:
Returns:

TypeVar(VariableLikeType, Variable, DataArray, Dataset, DataGroup[Any]) – A variable containing True if any input values (along the given dimension) are True.

See also

scipp.all

Logical AND.

Examples

>>> import scipp as sc
>>> x = sc.array(dims=['x'], values=[False, False, False])
>>> sc.any(x)
<scipp.Variable> ()       bool        <no unit>  False
>>> y = sc.array(dims=['x'], values=[False, True, False])
>>> sc.any(y)
<scipp.Variable> ()       bool        <no unit>  True

Along a dimension:

>>> x = sc.array(dims=['x', 'y'], values=[[False, True], [False, False]])
>>> sc.any(x, 'y')
<scipp.Variable> (x: 2)       bool        <no unit>  [True, False]