scipp.Bins
scipp.Bins#
- class scipp.Bins(obj)#
Proxy for access to bin contents and operations on bins of a variable.
This class is returned from the bins property of variables and should generally not be created directly.
- __init__(obj)#
Methods
__init__
(obj)concat
([dim])Concatenate bins element-wise by concatenating bin contents along their internal bin dimension.
concatenate
(other, *[, out])Concatenate bins element-wise by concatenating bin contents along their internal bin dimension.
mean
()Mean of each bin.
size
()Number of events or elements in a bin.
sum
()Sum of each bin.
Attributes
Coords of the bins
Constituents of binned data, as supported by
sc.bins()
.Coords of the bins
Data of the bins
Masks of the bins
Coords and attrs of the bins
Unit of the bin elements
- property attrs: MutableMapping[str, scipp._scipp.core.Variable]#
Coords of the bins
- Return type
- concat(dim=None)#
Concatenate bins element-wise by concatenating bin contents along their internal bin dimension.
This is a reduction operation similar to
scipp.sum()
but operates on binned data. Elements (bins) are concatenated along their internal dimension.
- concatenate(other, *, out=None)#
Concatenate bins element-wise by concatenating bin contents along their internal bin dimension.
The bins to concatenate are obtained element-wise from self and other.
- property constituents: Dict[str, Union[str, scipp._scipp.core.Variable, scipp._scipp.core.DataArray]]#
Constituents of binned data, as supported by
sc.bins()
.
- property coords: MutableMapping[str, scipp._scipp.core.Variable]#
Coords of the bins
- Return type
- property data: scipp._scipp.core.Variable#
Data of the bins
- Return type
- property masks: MutableMapping[str, scipp._scipp.core.Variable]#
Masks of the bins
- Return type
- mean()#
Mean of each bin.
- Returns
Union
[Variable
,DataArray
] – The mean of each of the input bins.- Seealso
scipp.mean()
for calculating the mean of non-bin data
- property meta: MutableMapping[str, scipp._scipp.core.Variable]#
Coords and attrs of the bins
- Return type
- size()#
Number of events or elements in a bin.
- sum()#
Sum of each bin.
- Returns
Union
[Variable
,DataArray
] – The sum of each of the input bins.- Seealso
scipp.sum()
for summing non-bin data
- property unit: scipp._scipp.core.Unit#
Unit of the bin elements
- Return type