python正态分布_Python-正态分布

python正态分布_Python-正态分布_第1张图片

python正态分布

Python-正态分布 (Python - Normal Distribution)

The normal distribution is a form presenting data by arranging the probability distribution of each value in the data.Most values remain around the mean value making the arrangement symmetric.

正态分布是通过排列数据中每个值的概率分布来呈现数据的形式,大多数值保持在平均值附近,从而使排列对称。

We use various functions in numpy library to mathematically calculate the values for a normal distribution. Histograms are created over which we plot the probability distribution curve.

我们使用numpy库中的各种函数来数学计算正态分布的值。 将创建直方图,在该直方图上绘制概率分布曲线。


import matplotlib.pyplot as plt
import numpy as np

mu, sigma = 0.5, 0.1
s = np.random.normal(mu, sigma, 1000)

# Create the bins and histogram
count, bins, ignored = plt.hist(s, 20, normed=True)

# Plot the distribution curve
plt.plot(bins, 1/(sigma * np.sqrt(2 * np.pi)) *
    np.exp( - (bins - mu)**2 / (2 * sigma**2) ),       linewidth=3, color='y')
plt.show()

Its output is as follows −

输出如下-

python正态分布_Python-正态分布_第2张图片

翻译自: https://www.tutorialspoint.com/python_data_science/python_normal_distribution.htm

python正态分布

你可能感兴趣的:(python,numpy,人工智能,数据可视化,javascript,ViewUI)