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)

The Safest Way to Get what you Want is to Try and Deserve What you Want.
原文地址:https://www.cnblogs.com/Shinered/p/9802579.html