This is a pre-release version (2.5.0.dev0+git20251130.2de293a). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.5.0.dev0+git20251130.2de293a / 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