scipp.bin
scipp.bin#
- scipp.bin(x, *, edges=None, groups=None, erase=None)#
Create binned data by binning input along all dimensions given by edges.
This does not histogram the data, each output bin will contain a “list” of input values.
At least one argument of
edges
andgroups
is 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.
- Parameters
x (
DataArray
) – Input data.edges (
Optional
[Sequence
[Variable
]], default:None
) – Bin edges, one per dimension to bin in.groups (
Optional
[Sequence
[Variable
]], default:None
) – Keys to group input by one per dimension to group in.erase (
Optional
[Sequence
[Variable
]], default:None
) – Dimension labels to remove from output.
- Returns
DataArray
– Binnedx
.
See also
scipp.histogram
For histogramming data.
scipp.bins
For creating binned data based on explicitly given index ranges.