histogram(x, bins=10, range=None, weights=None, density=False)¶
Computes the histogram of a set of data.
x (cupy.ndarray) – Input array.
range (2-tuple of float, optional) – The lower and upper range of the bins. If not provided, range is simply
(x.min(), x.max()). Values outside the range are ignored. The first element of the range must be less than or equal to the second. range affects the automatic bin computation as well. While bin width is computed to be optimal based on the actual data within range, the bin count will fill the entire range including portions containing no data.
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 (cupy.ndarray, optional) – An array of weights, of the same shape as x. Each value in x only contributes its associated weight towards the bin count (instead of 1).
- Return type
This function may synchronize the device.