Kaydet (Commit) e6dc5312 authored tarafından Mark Dickinson's avatar Mark Dickinson

Issue #4869: clarify documentation for random.expovariate.

üst fde5b803
...@@ -210,9 +210,11 @@ be found in any statistics text. ...@@ -210,9 +210,11 @@ be found in any statistics text.
.. function:: expovariate(lambd) .. function:: expovariate(lambd)
Exponential distribution. *lambd* is 1.0 divided by the desired mean. (The Exponential distribution. *lambd* is 1.0 divided by the desired
parameter would be called "lambda", but that is a reserved word in Python.) mean. It should be nonzero. (The parameter would be called
Returned values range from 0 to positive infinity. "lambda", but that is a reserved word in Python.) Returned values
range from 0 to positive infinity if *lambd* is positive, and from
negative infinity to 0 if *lambd* is negative.
.. function:: gammavariate(alpha, beta) .. function:: gammavariate(alpha, beta)
......
...@@ -413,9 +413,11 @@ class Random(_random.Random): ...@@ -413,9 +413,11 @@ class Random(_random.Random):
def expovariate(self, lambd): def expovariate(self, lambd):
"""Exponential distribution. """Exponential distribution.
lambd is 1.0 divided by the desired mean. (The parameter would be lambd is 1.0 divided by the desired mean. It should be
called "lambda", but that is a reserved word in Python.) Returned nonzero. (The parameter would be called "lambda", but that is
values range from 0 to positive infinity. a reserved word in Python.) Returned values range from 0 to
positive infinity if lambd is positive, and from negative
infinity to 0 if lambd is negative.
""" """
# lambd: rate lambd = 1/mean # lambd: rate lambd = 1/mean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment