scipp.bins_like¶
- scipp.bins_like(x, fill_value)¶
Create a binned variable by “broadcasting” fill values to bins of given sizes.
The dimensions and shape of
fill_value
must be such that they can be broadcast to those ofx
. Each element offill_value
defines the values of all the bin elements of the corresponding bin. The output shares the bin indices ofx
.- Parameters
x (Union[scipp._scipp.core.Variable, scipp._scipp.core.DataArray, scipp._scipp.core.Dataset]) – Binned variable or data array serving as prototype for bin sizes.
fill_value (scipp._scipp.core.Variable) – Fill values to use for the bins
- Returns
Variable containing fill value in bins.
- Return type