What is the result of np.arange(5)?
Correct answer
A. [0, 1, 2, 3, 4]
12 views
A. [0, 1, 2, 3, 4]
12 views
np.arange(5) returns [0, 1, 2, 3, 4]. Like Python's range(), it starts at 0 by default and stops before the given value, so five numbers are produced.
The full form is np.arange(start, stop, step).
Keep preparing with more Data Science MCQs on MCQsExam.com.
Not sure why the answer is A? Ask here and get an explanation.