scipp.subtract#
- scipp.subtract(minuend, subtrahend)#
Element-wise difference.
Equivalent to:
minuend - subtrahend
- Parameters:
minuend (VariableLike) – Minuend.
subtrahend (VariableLike) – Subtrahend.
- Returns:
VariableLike –
subtrahendsubtracted fromminuend.
Examples
>>> import scipp as sc >>> a = sc.array(dims=['x'], values=[10, 20, 30], unit='m') >>> b = sc.array(dims=['x'], values=[1, 2, 3], unit='m') >>> sc.subtract(a, b) <scipp.Variable> (x: 3) int64 [m] [9, 18, 27]
Or equivalently in operator notation:
>>> a - b <scipp.Variable> (x: 3) int64 [m] [9, 18, 27]
Notes
See the guide on computation for general concepts and broadcasting behavior.