You are viewing an older version (2.4.3). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.4.3 / numpy / random / RandomState / rand

cython_function_or_method

numpy.random:RandomState.rand

Summary

Random values in a given shape.

Extended Summary

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

Parameters

d0, d1, ..., dn : int, optional

The dimensions of the returned array, must be non-negative. If no argument is given a single Python float is returned.

Returns

out : ndarray, shape ``(d0, d1, ..., dn)``

Random values.

Examples

np.random.rand(3,2)

See also

random

Aliases

  • numpy.random.rand
  • numpy.random.RandomState.rand