dpnp.histogramdd
- dpnp.histogramdd(sample, bins=10, range=None, density=None, weights=None)[source]
Compute the multidimensional histogram of some data.
For full documentation refer to
numpy.histogramdd.Warning
This function may synchronize in order to check a monotonically increasing array of bin edges. This may harm performance in some applications.
- Parameters:
sample ({dpnp.ndarray, usm_ndarray}) -- Input (N, D)-shaped array to be histogrammed.
bins ({sequence, int}, optional) --
The bin specification:
A sequence of arrays describing the monotonically increasing bin edges along each dimension.
The number of bins for each dimension (nx, ny, ... =bins)
The number of bins for all dimensions (nx=ny=...=bins).
Default:
10.range ({None, 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
Nonein the sequence results in the minimum and maximum values being used for the corresponding dimension.Noneis equivalent to passing a tuple of DNonevalues.Default:
None.density ({None, bool}, optional) --
If
FalseorNone, the default, returns the number of samples in each bin. IfTrue, returns the probability density function at the bin,bin_count / sample_count / bin_volume.Default:
None.weights ({None, dpnp.ndarray, usm_ndarray}, optional) --
An (N,)-shaped array of values w_i weighing each sample (x_i, y_i, z_i, ...). Weights are normalized to
1if density isTrue. If density isFalse, the values of the returned histogram are equal to the sum of the weights belonging to the samples falling into each bin. IfNoneall samples are assigned a weight of1.Default:
None.
- Returns:
H (dpnp.ndarray) -- The multidimensional histogram of sample x. See density and weights for the different possible semantics.
edges (list of {dpnp.ndarray or usm_ndarray}) -- A list of D arrays describing the bin edges for each dimension.
See also
dpnp.histogram1-D histogram
dpnp.histogram2d2-D histogram
Examples
>>> import dpnp as np >>> r = np.random.normal(size=(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)