What is the output of np.random.randint(1, 10, size=(2, 3))?
Correct answer
A. A 2x3 array with random integers between 1 and 10
15 views
A. A 2x3 array with random integers between 1 and 10
15 views
It returns a 2×3 array of random integers from 1 up to, but not including, 10. In randint(low, high, size) the upper bound is exclusive, so the values lie between 1 and 9.
The size argument sets the shape of the output.
Keep preparing with more Data Science MCQs on MCQsExam.com.
Not sure why the answer is A? Ask here and get an explanation.