arviz_stats.histogram2d#
- arviz_stats.histogram2d(x, y, bins=None, range=None, weights=None, axis=-1, density=True, dim=None)[source]#
Compute a two-dimensional histogram for paired samples.
Plain arrays return
(histogram, x_edges, y_edges). DataArray inputs return a Dataset with variables namedhistogram,x_edges, andy_edges.- Parameters:
- x, yarray_like or
xarray.DataArray Paired samples with identical shapes.
- bins
None,str,intor array_like orpair, defaultNone Bin specification passed to
numpy.histogram2d.Noneor"auto"applies the default two-dimensional bin rule to each marginal, reduced to shared counts over batched input.- rangearray_like, optional
((xmin, xmax), (ymin, ymax))passed tonumpy.histogram2d.- weightsarray_like or
xarray.DataArray, optional Sample weights with the same shape as the samples.
- axis
int, sequence ofintorNone, default -1 Array axis or axes along which to reduce.
- densitybool, default
True Normalize the histogram as a probability density.
- dim
stror sequence ofstr, optional DataArray dimension or dimensions along which to reduce.
- x, yarray_like or
- Returns:
tupleorxarray.DatasetHistogram values and x and y bin edges.