Python‎ > ‎random‎ > ‎

random.gauss()

http://www.adilwaseem.com/

Introduction
gauss(mu, sigma) method of random.

Syntax
random.gauss(mu, sigma)->Gaussian Distribution Random

Parameters
mu=mean
sigma=Standard deviation.

Examples
The returns is:
import random
x=random.gauss(13,44)
print(x)

>>> 
56.7950546267066
>>>

The method return with:.
import operator
import random
c=operator.pos(a)
d=operator.pos(b)
f=c+d
list=[1,19,33,31]
g=sum(list)
print(f/g)

>>>
(0.05995071123597758+0j)
>>>

The method used the math values to generate random using operator.truediv()
import operator
import random
import math

a=math.acos(.65)
b=math.asin(.45)
c=math.atan(1)

d=random.betavariate(a,b)
f=random.gauss(b,c)
g=random.gammavariate(c,a)

h=operator.truediv(d,f)
i=operator.truediv(f,g)
j=operator.truediv(g,d)

list=[h,i,j]

l=max(map(lambda x:x, list))

print(l)

>>> 
426.5194858354276
>>>


Comments