[NumPy]-numpy.random.rand () function

numpy.random.rand()

Create an array of a given type and fill it with a uniformly distributed random sample [0, 1).


parameter:

d0, d1,…, dn: int, optional

The dimensions of the returned array must be non-negative.
If no parameters are provided, a single Python floating point number is returned.


return value:

ndarray, shape(d0, d1, …, dn)

Random value.


Examples:

>>> np.random.rand(3, 2)
array([[0.14022471, 0.96360618],
	   [0.37601032, 0.25528411],
	   [0.49313049, 0.94909878]])
Published 75 original articles · Liked 267 · Visits 5208

Guess you like

Origin blog.csdn.net/weixin_45961774/article/details/105666386