Numpy之random.randint产生随机整数

来源:互联网 发布:abb机器人软件下载 编辑:程序博客网 时间:2024/06/05 06:02

方法

numpy.random.randint(low, high=None, size=None, dtype='l')

参数

这个方法产生离散均匀分布的整数,这些整数大于等于low,小于high。

  • low : int
    产生随机数的最小值
  • high : int, optional
    给随机数设置个上限,即产生的随机数必须小于high
  • size : int or tuple of ints, optional
    输出的大小,可以是整数,或者元组
  • dtype : dtype, optional
    期望结果的类型

实验

这里写图片描述

原创粉丝点击