Python 代码实现 二项分布

import numpy as np
import matplotlib.pyplot as plt 
import math
from scipy import stats

n = 100 
p = 0.05
k = np.arange(0,n)
binomial = stats.binom.pmf(k,n,p)
plt.plot(k,binomial,'o-')
plt.title('binomial:n=%i,p=%.2f'%(n,p),fontsize=15)
plt.xlabel('number of sucess',fontproperties='SimHei')
plt.ylabel('probalility of sucess',fontsize=15)
plt.grid(True)
plt.show()

Python matplotlib 概率论与数理统计 伯努利分布 二项分布

相关文章:

  • 2022-12-23
  • 2021-04-05
  • 2021-04-01
  • 2022-12-23
  • 2021-10-10
  • 2021-11-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-07
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案