# jax.numpy.histogramddΒΆ

jax.numpy.histogramdd(sample, bins=10, range=None, weights=None, density=None)[source]ΒΆ

Compute the multidimensional histogram of some data.

LAX-backend implementation of histogramdd(). Original docstring below.

Parameters
• sample ((N, D) array, or (D, N) array_like) β The data to be histogrammed.

• bins (sequence or int, optional) β The bin specification:

• range (sequence, optional) β A sequence of length D, each an optional (lower, upper) tuple giving the outer bin edges to be used if the edges are not given explicitly in bins. An entry of None in the sequence results in the minimum and maximum values being used for the corresponding dimension. The default, None, is equivalent to passing a tuple of D None values.

• density (bool, optional) β If False, the default, returns the number of samples in each bin. If True, returns the probability density function at the bin, bin_count / sample_count / bin_volume.

• weights ((N,) array_like, optional) β An array of values w_i weighing each sample (x_i, y_i, z_i, β¦). Weights are normalized to 1 if normed is True. If normed is False, the values of the returned histogram are equal to the sum of the weights belonging to the samples falling into each bin.

Returns

• H (ndarray) β The multidimensional histogram of sample x. See normed and weights for the different possible semantics.

• edges (list) β A list of D arrays describing the bin edges for each dimension.

histogram()

1-D histogram

histogram2d()

2-D histogram

Examples

>>> r = np.random.randn(100,3)
>>> H, edges = np.histogramdd(r, bins = (5, 8, 4))
>>> H.shape, edges[0].size, edges[1].size, edges[2].size
((5, 8, 4), 6, 9, 5)