1.np.random.rand(d0,d1,...)

2.np.random.randn(d0,d1,...)

d0,d1,... refer to the dimension of matrix you want to generate, "rand" generates number belong to [0, 1)(uniform distribution) and "randn"  generates number~N(0,1)(normal distribution)

if you don't assign any value to d0,d1,....  then 1 and 2 return a number with "float" type

20190924_1:numpy.random.**的用法

 

相关文章: