- scipp.bins(*, data, dim, begin=None, end=None)#
Create a binned variable from bin indices.
The elements of the returned variable are “bins”, defined as views into
data. The returned variable keeps and manages a copy of
endmust have the same dims and shape and
dtype=sc.DType.int64. The output dims and shape are given by
begin. If only
beginis given, each bucket is a slice containing a non-range slice of
dataat the given indices. If neither
endare given, the output has
dims=[dim]and contains all non-range slices along that dimension.
None) – Optional end indices of bins, used for slicing
data. If not provided,
beginis used as starting offsets for each bin, i.e., the end of the Nth bin is set to the begin of the N+1st bin.
str) – Dimension of
datathat will be sliced to obtain data for any given bin.
Variable– Variable containing data in bins.
For creating DataArrays based on binning of coord value instead of explicitly given index ranges.