On this page
random.betavariate
Up: random | Next: random.binomialvariate
Rel: random.binomialvariate, random.choice, random.choices, random.expovariate
Ref: docs.python.org — random.betavariate
Tags: #public #python3 #stdlib #random
Import
import random
from random import betavariate
Signature & Overview
random.betavariate(alpha, beta)
Beta distribution.
Usage
import random
rng = random.Random(1)
x = rng.betavariate(2.0, 5.0)
assert 0.0 <= x <= 1.0
Gotchas
- Both
alphaandbetamust be> 0: Returns values in[0.0, 1.0], commonly used for modeling probabilities or A/B conversion rates.
REPL Inspect
from random import betavariate
help(betavariate)
Linked from
- tuts/python3/stdlib_module/random
- tuts/python3/stdlib_module/random/binomialvariate
- tuts/python3/stdlib_module/random/choice
- tuts/python3/stdlib_module/random/choices
- tuts/python3/stdlib_module/random/expovariate
- tuts/python3/stdlib_module/random/gammavariate
- tuts/python3/stdlib_module/random/gauss
- tuts/python3/stdlib_module/random/getrandbits
- tuts/python3/stdlib_module/random/getstate
- tuts/python3/stdlib_module/random/lognormvariate
- tuts/python3/stdlib_module/random/normalvariate
- tuts/python3/stdlib_module/random/paretovariate
- tuts/python3/stdlib_module/random/randbytes
- tuts/python3/stdlib_module/random/randint
- tuts/python3/stdlib_module/random/random
- tuts/python3/stdlib_module/random/Random_class
- tuts/python3/stdlib_module/random/randrange
- tuts/python3/stdlib_module/random/sample
- tuts/python3/stdlib_module/random/seed
- tuts/python3/stdlib_module/random/setstate
- tuts/python3/stdlib_module/random/shuffle
- tuts/python3/stdlib_module/random/SystemRandom
- tuts/python3/stdlib_module/random/triangular
- tuts/python3/stdlib_module/random/uniform
- tuts/python3/stdlib_module/random/vonmisesvariate
- tuts/python3/stdlib_module/random/weibullvariate
Related notes
- tuts/python3/stdlib_module/random/binomialvariate Linked here; links to this page; shared tags: #random, #stdlib
- tuts/python3/stdlib_module/random/choice Linked here; links to this page; shared tags: #random, #stdlib
- tuts/python3/stdlib_module/random/choices Linked here; links to this page; shared tags: #random, #stdlib
- tuts/python3/stdlib_module/random/expovariate Linked here; links to this page; shared tags: #random, #stdlib
- tuts/python3/stdlib_module/random/random Linked here; links to this page; shared tags: #random, #stdlib
- tuts/python3/stdlib_module/random/gammavariate links to this page; shared tags: #random, #stdlib
- tuts/python3/stdlib_module/random/gauss links to this page; shared tags: #random, #stdlib
- tuts/python3/stdlib_module/random/getrandbits links to this page; shared tags: #random, #stdlib
- tuts/python3/stdlib_module/random/getstate links to this page; shared tags: #random, #stdlib
- tuts/python3/stdlib_module/random/lognormvariate links to this page; shared tags: #random, #stdlib