- Python: 3.8.11
- Numpy: 1.20.1
- OS: Ubuntu Kylin 20.04
- Conda: 4.10.1
- Jupyter lab: 3.1.4
Code sample
import numpy as np
Copy the code
# normal distribution
# LoC mean value and center point
# Scale standard deviation
# size shape
np.random.normal(loc=0.0,scale=0.5,size=(2.3))
array([[-0.15069357.0.26875581.0.31638909], [...0.71754672, -0.05140111, -0.22627883]])
Copy the code
np.random.normal(loc=0.0,scale=0.5,size=(2.3))
array([[-0.25230081, -0.46464863, -1.16539577], [...0.48035575.0.32226706.0.4507823 ]])
Copy the code
The source code to learn
help(np.random.normal)
Help on built-in function normal:
normal(...) method of numpy.random.mtrand.RandomState instance
normal(loc=0.0, scale=1.0, size=None)
Draw random samples from a normal (Gaussian) distribution.
The probability density function of the normal distribution, first
derived by De Moivre and 200 years later by both Gauss and Laplace
independently [2] _,isoften called the bell curve because of its characteristic shape (see the example below). The normal distributions occurs oftenin nature. For example, it
describes the commonly occurring distribution of samples influenced
by a large number of tiny, random disturbances, each with its own
unique distribution [2]_.
.. note::
New code should use the ``normal`` method of a ``default_rng()``
instance instead; please see the :ref:`random-quick-start`.
......
Copy the code
Learning to recommend
- Python documentation – English
- Python documentation – Chinese
- Python code PEP
- Google version of the Python specification
- Python source code
- Python PEP
- Optimal kirin
- The nuggets platform
- Gitee platform
Python is open source, cross-platform, interpretive, interactive, and worth learning. Python’s design philosophy: elegant, unambiguous, simple. Advocate one way, preferably only one way to do one thing. Code should be written in accordance with specifications to facilitate communication and understanding. Every language has its own unique ideas. Beginners need to change their thinking, practice and accumulate.