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 of x. Each element of fill_value defines the values of all the bin elements of the corresponding bin. The output shares the bin indices of x.

Parameters:
  • x (VariableLike) – Binned variable or data array serving as prototype for bin sizes.

  • fill_value (Variable) – Fill values to use for the bins.

Returns:

Variable – Variable containing fill value in bins.