Full name
random.expovariate
Library
random
Syntax
random.expovariate(lambd)
Description
The random.expovariate function returns a random number drawn from an exponential distribution.
Parameters
- lambd: Lambda parameter of the exponential distribution.
Result
The random.expovariate function returns a real number in the range [0, + infinity) if the lambd parameter is positive, or a real number in the range (-infinite, 0] if the lambd parameter is negative.
Examples
We can generate a random number extracted from an exponential distribution with a lambda parameter equal to 0.5 with the following code:
random.expovariate(0.5)
1.6287123635584828