randn和normal之间的Python区别 [英] Python difference between randn and normal

查看:283
本文介绍了randn和normal之间的Python区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Python的numpy.random模块中的randnnormal函数.这些功能与我在 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区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆