本文共 329 字,大约阅读时间需要 1 分钟。
4、np.random.normal(loc=0.0, scale=1.0, size=None)
作用:
生成高斯分布的概率密度随机数loc:float 此概率分布的均值(对应着整个分布的中心centre)scale:float 此概率分布的标准差(对应于分布的宽度,scale越大越矮胖,scale越小,越瘦高)size:int or tuple of ints 输出的shape,默认为None,只输出一个值
举例:
nd1 = np.random.normal(loc=1,scale=2,size=2)#array([-0.46982446, -1.28956852])
转载地址:http://ypfti.baihongyu.com/