scipp.full_like#

scipp.full_like(obj, /, value, *, variance=None)#

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 or scipp.DataArray) – Input object defining dims, shape, unit, and dtype of the output

  • value (Any) – The value to fill the data with.

  • variance (Optional[Any], default: None) – The variance to fill the Variable with. If None or not provided, the variances will not be set.

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.