Explore Library
Quiz

Why Vectorization Beats Python Loops

Understanding the real reason NumPy vectorized operations outperform pure-Python loops.

You replace a Python for-loop that adds two lists element-wise with NumPy vectorized addition (a + b) on 10-million-element arrays and see a large speedup. Which statement BEST explains the primary source of this speedup?