mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Small speed-up for NormalDist.samples (GH-94730)
This commit is contained in:
parent
e8e4b550f5
commit
c9118afd04
1 changed files with 1 additions and 1 deletions
|
@ -1193,7 +1193,7 @@ class NormalDist:
|
|||
"Generate *n* samples for a given mean and standard deviation."
|
||||
gauss = random.gauss if seed is None else random.Random(seed).gauss
|
||||
mu, sigma = self._mu, self._sigma
|
||||
return [gauss(mu, sigma) for i in range(n)]
|
||||
return [gauss(mu, sigma) for _ in repeat(None, n)]
|
||||
|
||||
def pdf(self, x):
|
||||
"Probability density function. P(x <= X < x+dx) / dx"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue