Python生成随机数

1.numpy.random.choice()

#均匀随机采样,采集3个数字
 np.random.choice(5, 3)
# array([0, 3, 4])
# This is equivalent to np.random.randint(0,5,3)

2.numpy.random.randint()

生成在[Low, high)上离散均匀分布的整数值。

如果high=None, 则取值区间变为[0,Low)

posted @ 2018-10-17 10:34  卷积  阅读(183)  评论(0编辑  收藏  举报