scipp.zeros_like#

scipp.zeros_like(obj, /)#

Return a new object with the same dims, shape, unit, and dtype as the input and all elements initialized to 0.

If the input has variances, all variances in the output are set to 0. If the input is a DataArray, coordinates and attributes are shallow-copied and masks are deep-copied.

Parameters

obj (scipp.Variable or scipp.DataArray) – Input object defining dims, shape, unit, and dtype of the output.

Returns

Same type as input – New object of zeros.

See also

scipp.zeros

Create zeros but based on given dims and shape.

scipp.ones_like

Create an object initialized with ones.

scipp.full_like

Create an object filled with a given value.

scipp.empty_like

Create an object with uninitialized elements.