scipp.divide
scipp.divide#
- scipp.divide(dividend, divisor)#
Element-wise true division.
Equivalent to:
dividend / divisor
The result always contains fractional parts even when the inputs are integers:
- Parameters
- Returns
Union
[Variable
,DataArray
,Dataset
,DataGroup
] – Quotient ofdivident
anddivisor
.
Examples
>>> sc.divide(sc.arange('x', -2, 3), sc.scalar(2)).values array([-1. , -0.5, 0. , 0.5, 1. ]) >>> sc.divide(sc.arange('x', -2.0, 3.0), sc.scalar(2.0)).values array([-1. , -0.5, 0. , 0.5, 1. ])
Of equivalently in operator notation
>>> (sc.arange('x', -2.0, 3.0) / sc.scalar(2.0)).values array([-1. , -0.5, 0. , 0.5, 1. ])
See also
Note
See the guide on computation for general concepts and broadcasting behavior.