Test yourself under real exam conditions: 50 timed questions, 60 on the clock, pass mark 70%%. Instant score with a full review of everything you got wrong. Free — no account needed.
Exam details
np.array([1, 2, 3]) converts a Python list into a NumPy ndarray.
np.zeros(5) returns array([0., 0., 0., 0., 0.]).
np.eye(3) returns a 3×3 array with ones on the diagonal and zeros elsewhere.
np.arange(0, 10, 2) return?It returns array([0, 2, 4, 6, 8]) — values from 0 up to (not including) 10 with step 2.
np.linspace(0, 1, 5) returns array([0., 0.25, 0.5, 0.75, 1.]).