cupynumeric.histogramdd#

cupynumeric.histogramdd(
coords: ndarray,
bins: tuple[ndarray, ...] | tuple[int, ...] | int = 10,
range: Sequence[tuple[int, int] | tuple[float, float] | None] | None = None,
density: bool = False,
weights: ndarray | None = None,
) tuple[ndarray, Sequence[npt.ArrayLike]]#

Compute the multidimensional histogram of a dataset.

Parameters:
  • coords ((N, D) array, or (N, D) array_like) – Input data. The data to be histogrammed. An array, each row is a coordinate in a D-dimensional space - such as histogramdd(np.array([p1, p2, p3])).

  • bins (sequence or 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).

  • 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 density is True. If density 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:

  • hist (ndarray) – The multidimensional histogram of given sample. See density and weights for a description of the possible semantics.

  • edges (sequence) – A list of D arrays describing the bin edges for each dimension.

Availability:

Multiple GPUs, Multiple CPUs