当前位置:主页 > 软件编程 > Python代码 >
时间:2021-02-18 11:18:55 | 栏目:Python代码 | 点击:次
实例如下所示:
# -*- coding: utf-8 -*- import numpy as np random = np.random.RandomState(0)#RandomState生成随机数种子 for i in range(200):#随机数个数 a = random.uniform(-0.1, 0.1)#随机数范围 print round(a, 2)#随机数精度要求