🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← All topics

Quiz: NumPy: questions with answers

10 questions, each with the answer and a short explanation.

Take the timed quiz + get a certificate →
  1. Q1. What does marks.argmax() return?
  2. Q2. For a 3×3 array of student scores (rows = students), which gives each student's average?
  3. Q3. What does arr[arr 50] do?
  4. Q4. Why are NumPy arrays faster than Python lists for maths?
  5. Q5. What is broadcasting?
  6. Q6. What does this print? (code)
  7. Q7. What does this print? (code)
  8. Q8. You change b = a[0:2] and then set b[0] = 99. What happens to a?
  9. Q9. Why does a NumPy array require all elements to share one dtype?
  10. Q10. Why create random numbers with np.random.defaultrng(42)?