scipp.all#

scipp.all(x, dim=None)#

Logical AND over input values.

Parameters:
Returns:

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

See also

scipp.any

Logical OR.

Examples

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

Along a dimension:

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