nlcpy.random.RandomState.rand

RandomState.rand(self, size)

Random values in a given shape.

Create an array of the given shape and populate it with random samples from a uniform distribution over [0, 1).

Parameters
sizeint or tuple of ints, optional

The dimensions of the returned array, must be non-negative.

Returns
outndarray

Random values, with shape size.

See also

RandomState.random

Returns random floats in the half-open interval [0.0, 1.0).

Examples

>>> import nlcpy as vp
>>> vp.random.rand(3,2)  
array([[0.2501974 , 0.01560572],  # random
       [0.93670877, 0.6073555 ],  # random
       [0.18378925, 0.22068119]]) # random