scipp.zeros_like#

scipp.zeros_like(var)#

Return a Variable or DataArray with the same dims, shape, unit, and dtype as the input and all values initialized to 0.

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

Parameters

var (Union[Variable, DataArray]) – Input object defining dims, shape, unit, and dtype of the output

Returns

Union[Variable, DataArray] – New object of zeros.

See also

zeros

Create zeros but based on given dims and shape

ones_like

Create an object initialized with ones