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

Method paretovariate

Lib/random.py:768–773  ·  view source on GitHub ↗

Pareto distribution. alpha is the shape parameter.

(self, alpha)

Source from the content-addressed store, hash-verified

766 return 0.0
767
768 def paretovariate(self, alpha):
769 """Pareto distribution. alpha is the shape parameter."""
770 # Jain, pg. 495
771
772 u = 1.0 - self.random()
773 return u ** (-1.0 / alpha)
774
775 def weibullvariate(self, alpha, beta):
776 """Weibull distribution.

Callers 1

test_zeroinputsMethod · 0.95

Calls 1

randomMethod · 0.45

Tested by 1

test_zeroinputsMethod · 0.76