scipp.ones_like(var, /)#

Constructs a new object with the same dims, shape, unit and dtype as the input (Variable or DataArray), but with all values initialized to 1. If the input has variances, all variances in the output are set to 1. If the input is a DataArray, coordinates and attributes are shallow-copied and masks are deep copied.


var (Union[Variable, DataArray]) – Input variable or data array.


scipp.ones() scipp.zeros_like()

Return type

Union[Variable, DataArray]