1,正态分布,均匀分布,泊松分布
(1)生成数据:
import numpy as JS
from numpy import random as nr
JS.set_printoptions(precision = 2)
#随机生成4行3列的矩阵
r1 = nr.rand(4,3)
r2 = nr.randn(4,3)
#随机生成(0,10)的4行3列的矩阵
r3 = nr.randint(0,10,(4,3))
print(r1)
print(r2)
print(r3)
print('------------------')
#正态分布,随机生成一个均值100和方差10的4行3列的矩阵
r4 = nr.normal(100,10,(4,3))
#均匀分布,在(10,20)随机生成4行3列的矩阵
r5 = nr.uniform(10,20,(4,3))
#泊松分布
r6 = nr.poisson(2.0,(4,3))
print(r4)
print(r5)
print(r6)
(2),数据打印: