bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / random / RandomState / standard_normal
cython_function_or_method
numpy.random:RandomState.standard_normal
Signature
def standard_normal ( size = None ) Summary
Draw samples from a standard Normal distribution (mean=0, stdev=1).
Extended Summary
Parameters
size: int or tuple of ints, optionalOutput shape. If the given shape is, e.g.,
(m, n, k), thenm * n * ksamples are drawn. Default is None, in which case a single value is returned.
Returns
out: float or ndarrayA floating-point array of shape
sizeof drawn samples, or a single sample ifsizewas not specified.
Notes
For random samples from the normal distribution with mean mu and standard deviation sigma, use one of
mu + sigma * np.random.standard_normal(size=...) np.random.normal(mu, sigma, size=...)
Examples
np.random.standard_normal()
✗s = np.random.standard_normal(8000)
✓s
✗s.shape s = np.random.standard_normal(size=(3, 4, 2)) s.shape✓
3 + 2.5 * np.random.standard_normal(size=(2, 4))
✗See also
- normal
Equivalent function with additional
locandscalearguments for setting the mean and standard deviation.- random.Generator.standard_normal
which should be used for new code.
Aliases
-
numpy.random.standard_normal -
numpy.random.RandomState.standard_normal