np.random.randint()的用法

匿名 (未验证) 提交于 2019-12-02 23:34:01

np.random.randint()的用法:
np.random.randint(low,high=None,size=None,dtype=‘l’)
Method: if low=num1,while high=num2,return random integers from low to high
if low=num1,while high=None,return random integers from zero to low
if low=num1,while size = num,return num integers from zero to low
if low=num1,high=num2,size=(n,m),return a n lines m columns array,in which the num from num1 to num2

a = np.random.randint(10,size=(10,1)) #10行一列
print(a)

[[5]
[7]
[8]
[2]
[1]
[2]
[4]
[0]
[7]
[1]]

文章来源: https://blog.csdn.net/ggfujfdd/article/details/90312354
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!