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

Method samples

Lib/statistics.py:1250–1256  ·  view source on GitHub ↗

Generate *n* samples for a given mean and standard deviation.

(self, n, *, seed=None)

Source from the content-addressed store, hash-verified

1248 return cls(*_mean_stdev(data))
1249
1250 def samples(self, n, *, seed=None):
1251 "Generate *n* samples for a given mean and standard deviation."
1252 rnd = random.random if seed is None else random.Random(seed).random
1253 inv_cdf = _normal_dist_inv_cdf
1254 mu = self._mu
1255 sigma = self._sigma
1256 return [inv_cdf(rnd(), mu, sigma) for _ in repeat(None, n)]
1257
1258 def pdf(self, x):
1259 "Probability density function. P(x <= X < x+dx) / dx"

Callers 1

Calls 1

repeatFunction · 0.70

Tested by 1