numpy.random.rand()

numpy.random.randn (d0, d1, … , DN) is to return one or more sample values from the standard normal distribution.  
numpy.random.rand (d0, d1, … , DN) in [0,1].   

 

numpy.random.rand (d0,d1,… ,dn)

The rand function generates data between [0,1] according to the given dimension, including 0 and excluding 1DN table. The return value of each dimension is the array of the specified dimension

np.random.rand(4,2)
array([[0.64959905, 0.14584702],
       [0.56862369, 0.5992007 ],
       [0.42512475, 0.83075541],
       [0.75685279, 0.00910825]])

np.random.rand(4,3,2) # shape: 4*3*2
array([[[0.07304796, 0.48810928],
        [0.59523586, 0.83281804],
        [0.47530734, 0.50402275]],

       [[0.63153869, 0.19636159],
        [0.93727986, 0.13564719],
        [0.11122609, 0.59646316]],

       [[0.17276155, 0.66621767],
        [0.81926792, 0.28781293],
        [0.20228714, 0.72412133]],

       [[0.29365696, 0.53956076],
        [0.19105394, 0.47044441],
        [0.85930046, 0.3867359 ]]])

 

Read More: