np.random.randint()的用法
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