Python生成随机数

mac2022-06-30  103

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)

转载于:https://www.cnblogs.com/Shinered/p/9802579.html

最新回复(0)