Skip to content
masterclass Buddy

NumPy · Function

np.random.rand

Creates an array of random values in a requested shape. Samples are uniform on [0, 1), including 0 but excluding 1.

Last updated

Syntax

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

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • numpy.random.random_sample
  • numpy.zeros
  • numpy.ones

Source: numpy.random.rand — NumPy v2.5 Manual. Checked 2026-11-03.