1. Home
  2. Data Science
  3. NumPy
  4. Which NumPy function creates a random array?

Added 16 Sep 2025

Which NumPy function creates a random array?

  1. np.random()
  2. np.random.rand() Correct answer
  3. np.rand()
  4. np.random_array()

Correct answer

B. np.random.rand()

16 views

MCQSEXAM

Explanation

np.random.rand() creates an array of given shape with random values from uniform distribution [0,1).

Reference

Asked in: Data Science Exams

https://numpy.org/doc/stable/reference/random/generated/numpy.random.rand.html

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More NumPy MCQs

Practise all NumPy MCQs

Similar MCQs