问题描述
我正在使用Python的numpy.random
模块中的randn
和normal
函数.这些功能与我在 http://docs.scipy.org 手册中所读的内容非常相似(它们都与高斯分布有关) ),但是我应该注意一些细微的区别吗?如果是这样,在什么情况下使用特定功能会更好?
I'm using the randn
and normal
functions from Python's numpy.random
module. The functions are pretty similar from what I've read in the http://docs.scipy.org manual (they both concern the Gaussian distribution), but are there any subtler differences that I should be aware of? If so, in what situations would I be better off using a specific function?
推荐答案
randn
似乎给出了一些标准正态分布的分布(均值0和方差1). normal
可以使用更多参数来进行更多控制.所以rand
似乎只是一个便利功能
randn
seems to give a distribution from some standardized normal distribution (mean 0 and variance 1). normal
takes more parameters for more control. So rand
seems to simply be a convenience function
这篇关于randn和normal之间的Python区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!