Tuesday, October 23, 2018

Creating Matrix with random values


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

d0,d1,d2...dn : The dimensions of the returned array, should all be positive. 
If no argument is given a single Python float is returned.

Example:
>>> np.random.rand(3,2)

array([[ 0.14022471,  0.96360618],  #random
       [ 0.37601032,  0.25528411],  #random
       [ 0.49313049,  0.94909878]]) #random



No comments:

Post a Comment