var1dmw(x, weights, bins, flow=False)¶
Histogram data with multiple weight variations and variable width bins.
x (array_like) – data to histogram
bins (array_like) – bin edges
weights (array_like) – weight variations for the elements of
x, first dimension is the shape of
x, second dimension is the number of weights.
density (bool) – normalize histogram bins as value of PDF such that the integral over the range is 1.
flow (bool) – if
Truethe under and overflow bin contents are added to the first and last bins, respectively
Using three different weight variations:
>>> x = np.random.randn(10000) >>> weights = np.abs(np.random.randn(x.shape, 3)) >>> bin_edges = [-3.0, -2.5, -1.5, -0.25, 0.25, 2.0, 3.0] >>> h, err = var1dmw(x, weights, bin_edges) >>> h.shape (6, 3) >>> err.shape (6, 3)