python统计数据分析教程:泊松分布概率图

2018-10-0119:28:27后端程序开发Comments3,018 views字数 390阅读模式

泊松分布是显示事件在预定时间段内发生的可能次数的分布。 它用于在给定的时间间隔内以恒定速率发生的独立事件。 泊松分布是一个离散函数,意味着事件只能被测量为发生或不发生,这意味着变量只能用整数来度量。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/bc/6088.html

我们使用具有内置函数的seaborn的python库来创建这样的概率分布图。 此外,scipy软件包有助于创建二项分布。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/bc/6088.html

from scipy.stats import poisson
import seaborn as sb

data_binom = poisson.rvs(mu=4, size=10000)
ax = sb.distplot(data_binom,
                  kde=True,
                  color='green',
                  hist_kws={"linewidth": 25,'alpha':1})
ax.set(xlabel='Poisson', ylabel='Frequency')

执行上面示例代码,得到以下结果 -文章源自菜鸟学院-https://www.cainiaoxueyuan.com/bc/6088.html

python统计数据分析教程:泊松分布概率图文章源自菜鸟学院-https://www.cainiaoxueyuan.com/bc/6088.html

  • 本站内容整理自互联网,仅提供信息存储空间服务,以方便学习之用。如对文章、图片、字体等版权有疑问,请在下方留言,管理员看到后,将第一时间进行处理。
  • 转载请务必保留本文链接:https://www.cainiaoxueyuan.com/bc/6088.html

Comment

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定