Which NumPy function creates a random array?
-
A
np.random()
-
B
np.random.rand()
Correct answer
-
C
np.rand()
-
D
np.random_array()
Correct answer
B. np.random.rand()
16 views
Explanation
np.random.rand() creates an array of given shape with random values from uniform distribution [0,1).
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ