Generate *n* samples for a given mean and standard deviation.
(self, n, *, seed=None)
| 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" |