arviz_stats.numba.array_stats.histogram#
- array_stats.histogram(ary, bins=None, range=None, weights=None, axis=-1, density=None)#
Compute histogram over provided axis.
- Parameters:
- aryarray_like
- bins
str
, scalar or array_like, optional - range(
float
,float
), optional - weightsarray_like, optional
- axis
int
, sequence ofint
orNone
, default -1 - densitybool, optional
- Returns:
- hist, bin_edgesarray_like
The shape of hist will be that of ary minus the dimensions in axis plus an extra dimension of length
nbins
, same for bin_edges with the difference the extra dimension has lengthnbins+1
.
Notes
The weights argument is not supported, but the density argument is supported. It uses the jit compiled histogram function to accelerate computations.
histogram
is called in multiple places along the codebase (like thekde
function for instance), so this function alone accelerates slightly a significant part of the codebase.