scipp.all#
- scipp.all(x, dim=None)#
Logical AND over input values.
- Parameters:
x (
scipp.typing.VariableLike) – Input data.dim (
Union[str,Iterable[str],None], default:None) – Dimension(s) along which to calculate the AND. If not given, the AND over all dimensions is calculated.
- Returns:
TypeVar(VariableLikeType,Variable,DataArray,Dataset,DataGroup[Any]) – A variable containingTrueif all input values (along the given dimension) areTrue.
See also
scipp.anyLogical 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]