import numpy as np
# from numpy import pi
import matplotlib.pyplot as plt
mu, sigma = 2, 0.5
s = np.random.normal(mu, sigma, 1)
while 1:
v = np.random.normal(mu, sigma, 1)
s = np.append(s, v)
plt.hist(s, bins=100, density=0.5)
# plt.show()
plt.pause(0.0001)
plt.clf()
用Python模拟正态分布
最新推荐文章于 2023-06-30 10:27:44 发布