scipp.binning.make_binned#
- scipp.binning.make_binned(x, *, edges=None, groups=None, erase=())#
Create binned data by binning input along all dimensions given by edges or groups.
Usually
scipp.bin()orscipp.group()should be preferred, unless the more precise control over which dimensions should be erased is required, or unless grouping and binning at the same time is required.This does not histogram the data, each output bin will contain a “list” of input values.
At least one argument of
edgesandgroupsis required.If the input is binned and certain bins are masked then changing the binning will apply the masks, i.e., masked bins are treated as empty.
Warning
When there is existing binning or grouping, the algorithm assumes that coordinates of the binned data are correct, i.e., compatible with the corresponding coordinate values in the individual bins. If this is not the case then the behavior is UNSPECIFIED. That is, the algorithm may or may not ignore the existing coordinates. If you encounter such as case, remove the conflicting coordinate, e.g., using
scipp.DataArray.drop_coords().- Parameters:
- Returns:
DataArray– Binnedx.
See also
scipp.histFor histogramming data.
scipp.binRecommended interface for binning data.
scipp.groupRecommended interface for grouping data.
scipp.binsFor creating binned data based on explicitly given index ranges.