scipp.abs#

scipp.abs(x, *, out=None)#

Element-wise absolute value.

Parameters:
  • x (VariableLike | _cpp.Unit) – Input data.

  • out (_cpp.Variable | None, default: None) – Optional output buffer. Only supported if x is a scipp.Variable.

Raises:

scipp.DTypeError – If the dtype has no absolute value, e.g., if it is a string.

Returns:

VariableLike | _cpp.Unit – The absolute values of the input.

See also

scipp.norm