scipp.floor_divide#

scipp.floor_divide(dividend, divisor)#

Element-wise floor division.

Equivalent to:

dividend // divisor
Parameters
Returns

Union[Variable, DataArray, Dataset] – Rounded down quotient.

Examples

>>> sc.floor_divide(sc.arange('x', -2, 3), sc.scalar(2)).values
array([-1, -1,  0,  0,  1])
>>> sc.floor_divide(sc.arange('x', -2.0, 3.0), sc.scalar(2.0)).values
array([-1., -1.,  0.,  0.,  1.])

Or equivalently in operator notation

>>> (sc.arange('x', -2.0, 3.0) // sc.scalar(2.0)).values
array([-1., -1.,  0.,  0.,  1.])

Note

See the guide on computation for general concepts and broadcasting behavior.