scipp.empty_like#
- scipp.empty_like(obj, dims=<scipp.core.like._NoArgProvided object>, shape=<scipp.core.like._NoArgProvided object>, sizes=<scipp.core.like._NoArgProvided object>, unit=<scipp.core.like._NoArgProvided object>, dtype=<scipp.core.like._NoArgProvided object>, with_variances=<scipp.core.like._NoArgProvided object>)#
Return a new object with the same dims, shape, unit, and dtype as the input and all elements uninitialized.
If the input has variances, all variances in the output exist but are uninitialized. If the input is a
DataArray, coordinates and attributes are shallow-copied and masks are deep-copied.Warning
Reading from any elements before writing to them produces undefined results.
- Parameters:
obj (
scipp.Variable | scipp.DataArray) – Input object defining dims, shape, unit, and dtype of the outputkwargs – Override arguments passed to
scipp.empty().
- Returns:
Same type as input– New object with uninitialized values and maybe variances.
See also
scipp.emptyCreate an uninitialized object based on given dims and shape.
scipp.zeros_likeCreate an object initialized with zeros.
scipp.ones_likeCreate an object initialized with ones.
scipp.full_likeCreate an object filled with a given value.