类似python中的rmrm

问题描述 投票:0回答:1

早上好!

我正在寻找在R中创建某些代码的类似物

[基本上,我有一个函数,除其他外,该函数获取用户提供的种子(默认值为NULL)以及特定的分布(默认值为rnorm),并输出9个随机数,另存为向量“ e ”。这就是R中的样子...

function (...other variables..., seed=NULL, dist=rnorm)

...other code...

e <- dist(9,...)

现在我将函数转换为Python,但是我似乎还找不到一个可以正常工作的模拟,用户可以在其中替换基本种子和发行版。

这是我到目前为止所拥有的...

def (...other variables..., seed=None, dist=?):

...other code...

e = dist(9)
python r function distribution normal-distribution
1个回答
0
投票

请参见numpy.random.normal功能(doc here

© www.soinside.com 2019 - 2024. All rights reserved.