标签:span col div image pre 概率分布 src lis nump
import numpy as np import matplotlib.pyplot as plt list = np.random.binomial(n=10, p=0.5,size = 10000) plt.hist(list, bins = 8,color = ‘g‘, alpha = 0.4,edgecolor = ‘b‘) plt.show()
import numpy as np import matplotlib.pyplot as plt list = np.random.poisson(9,10000) plt.hist(list, bins = 8, color = ‘r‘, alpha = 0.4, edgecolor = ‘r‘) plt.show()
list = np.random.uniform(0,10,10000) plt.hist(list,bins = 7,color = ‘g‘, alpha = 0.4, edgecolor = ‘b‘) plt.show()
list = np.random.normal(0,1,10000) plt.hist(list, bins = 8, color = ‘r‘, alpha = 0.5, edgecolor = ‘r‘) plt.show()
list = np.random.exponential(0.125, 10000) plt.hist(list, bins=8,color = ‘g‘, alpha = 0.4, edgecolor = ‘b‘) plt.show()
标签:span col div image pre 概率分布 src lis nump
原文地址:https://www.cnblogs.com/bigtreei/p/11967397.html