标签: numpy numpy-ndarray
两者似乎都从标准正态分布中抽取样本,只是standard_normal接受size的参数,而randn接受尺寸的参数。我对此还很陌生,所以有人可以告诉我他们的用途会有所不同吗?他们给出的结果会有所不同吗?
答案 0 :(得分:0)
如randn中所述:
randn
This is a convenience function. If you want an interface that takes a tuple as the first argument, use numpy.random.standard_normal instead.
1.17文档更加明确(注释randn在该版本中已移动):
This is a convenience function for users porting code from Matlab, and wraps numpy.random.standard_normal.