cupynumeric.random.binomial#
- cupynumeric.random.binomial(n, p, size=None)#
Draw samples from a binomial distribution.
Samples are drawn from a binomial distribution with specified parameters, n trials and p probability of success where n an integer >= 0 and p is in the interval
[0,1]
. (n may be input as a float, but it is truncated to an integer in use)- Parameters:
n (int) – Parameter of the distribution, >= 0. Floats are also accepted, but they will be truncated to integers.
p (float) – Parameter of the distribution, >= 0 and <=1.
size (int or tuple of ints, optional) – Output shape. If the given shape is, e.g.,
(m, n, k)
, thenm * n * k
samples are drawn. If size isNone
(default), a single value is returned.
- Returns:
out – Drawn samples from the parameterized binomial distribution, where each sample is equal to the number of successes over the n trials.
- Return type:
ndarray or scalar
See also
- Availability:
Multiple GPUs, Multiple CPUs