-
官方文档
numpy.random.randint(low, high=None, size=None, dtype='l')low (inclusive) to high (exclusive)的随机整数。
如果默认high=None,则取[0, low)
-
Parameters
-
low
从分布中提取的最小的整数
-
high
分布中提取的最大值
-
size:int or tuple of ints, optional
输出形态,例如(m,n,k),默认为None,表示给出单值
-
dtype:dtype, optional
获得的数据类型
返回值:int or ndarray of ints。size-shaped array
-
-
示例
np.random.randint(
np.random.randint()详解
最新推荐文章于 2025-11-24 14:45:27 发布

最低0.47元/天 解锁文章
1449

被折叠的 条评论
为什么被折叠?



