sweights_u¶
-
minkit.
sweights_u
(a, sweights, bins=10, range=None)[source]¶ Get the uncertainty associated to the s-weights related to sample a. Arguments are similar to those of
numpy.histogram()
. By definition, the uncertainty on the s-weights (for plotting), is defined as the sum of the squares of the weights in that bin, like\[\sigma = \sqrt{\sum_{b \in \delta x} \omega^2}\]- Parameters
a (numpy.ndarray) – array of data.
sweights (numpy.ndarray) – array of weights.
bins (int or numpy.ndarray) – bins for the histogram.
range (tuple(float, float) or None) – range of the histogram.
- Returns
Uncertainties for each bin of the histogram.
- Return type