【发布时间】:2018-05-30 14:14:57
【问题描述】:
我想为给定的数据数组x 拟合一些分布,比如伽玛,并绘制相应的密度函数。我可以通过seaborn.distplot 和scipy.stats 轻松做到这一点:
sns.distplot(x, fit = stats.gamma)
但是,假设我希望此分布的某些参数保持不变,例如 loc。当我使用来自scipy.stats 的fit 函数和固定的loc 时,我将其写为
stats.gamma.fit(x, floc = 0)
有没有办法在distplot 函数中将loc=0 传递给fit 并达到相同的结果?
【问题讨论】:
标签: python matplotlib seaborn data-fitting