scipp.full_like#
- scipp.full_like(obj, /, value, variance=<scipp.core.like._NoArgProvided object>, 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>)#
Return a new object with the same dims, shape, unit, and dtype as the input and all elements initialized to the given value.
If the input is a
DataArray
, coordinates and attributes are shallow-copied and masks are deep-copied.- Parameters:
obj (
scipp.Variable | scipp.DataArray
) – Input object defining dims, shape, unit, and dtype of the outputvalue (
Any
) – The value to fill the data with.variance (
Any
, default:<scipp.core.like._NoArgProvided object at 0x7f5810ff7590>
) – The variance to fill the Variable with. If None or not provided, the variances will not be set.kwargs – Override arguments passed to
scipp.full()
.
- Returns:
Same type as input
– New object with elements set to given values and variances.
See also
scipp.full
Create an object filled with given value based on given dims and shape.
scipp.zeros_like
Create an object initialized with zeros.
scipp.ones_like
Create an object initialized with ones.
scipp.empty_like
Create an object with uninitialized elements.