pygram11.var2d¶
-
pygram11.
var2d
(x, y, xbins, ybins, weights=None)[source]¶ Histogram the
x
,y
data with variable width binning.- Parameters
x (array_like) – first entries in the data pairs to histogram
y (array_like) – second entries in the data pairs to histogram
xbins (array_like) – bin edges for the
x
dimensionybins (array_like) – bin edges for the
y
dimensionweights (array_like, optional) – weights for each \((x_i, y_i)\) pair.
- Returns
numpy.ndarray
– The bin counts.numpy.ndarray
– The standard error of each bin count, \(\sqrt{\sum_i w_i^2}\).
Examples
A histogram of (
x
,y
) where the edges are defined by anumpy.logspace()
in both dimensions:>>> bins = numpy.logspace(0.1, 1.0, 10, endpoint=True) >>> h, __ = var2d(x, y, bins, bins)