MCPcopy Index your code
hub / github.com/python/cpython / weibullvariate

Method weibullvariate

Lib/random.py:775–784  ·  view source on GitHub ↗

Weibull distribution. alpha is the scale parameter and beta is the shape parameter.

(self, alpha, beta)

Source from the content-addressed store, hash-verified

773 return u ** (-1.0 / alpha)
774
775 def weibullvariate(self, alpha, beta):
776 """Weibull distribution.
777
778 alpha is the scale parameter and beta is the shape parameter.
779
780 """
781 # Jain, pg. 499; bug fix courtesy Bill Arms
782
783 u = 1.0 - self.random()
784 return alpha * (-_log(u)) ** (1.0 / beta)
785
786
787 ## -------------------- discrete distributions ---------------------

Callers 1

test_zeroinputsMethod · 0.95

Calls 1

randomMethod · 0.45

Tested by 1

test_zeroinputsMethod · 0.76