scipp.logical_not#

scipp.logical_not(x)#

Element-wise logical negation.

Equivalent to:

~a
Parameters:

x (TypeVar(VariableLikeType, Variable, DataArray, Dataset, DataGroup[Any])) – Input data.

Returns:

TypeVar(VariableLikeType, Variable, DataArray, Dataset, DataGroup[Any]) – The logical inverse of x.

Examples

Negate a boolean array:

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