The bedrock under everything
NumPy (Numerical Python) is the foundation of nearly all numerical computing in Python. Pandas is built on it. PyTorch and TensorFlow speak it. scikit-learn requires it. Most of PyArrow can hand you arrays compatible with it. If you understand ndarray, you understand the engine room of the modern Python data stack.
Current stable: NumPy 2.4.4 (March 2026). NumPy 2.0 (June 2024) was the breaking-change release that cleaned up legacy APIs; everything from 2.0+ is the modern world.
Why is it fast?
A Python list is a vector of pointers. Each element is a full Python object with its own type tag, reference count, and allocation. Iterating over a million-element list means a million pointer dereferences and a million Python-level method dispatches.
A NumPy ndarray is a single block of contiguous memory holding raw, typed values — no per-element pointers, no type tags. Iterating is a tight C loop with no Python overhead. The same operation that takes seconds on a list takes milliseconds on an array.
What you actually get
- Fast n-dimensional arrays — homogeneous typed data in contiguous memory.
- Vectorized operations — element-wise math runs at C speed without Python loops.
- Broadcasting — arrays of different shapes auto-align for element-wise ops.
- Universal functions (ufuncs) —
np.sin,np.exp,np.where, etc., all element-wise and parallelizable. - Linear algebra, FFT, random — the numerical toolkit comes in the box.
- Modern
GeneratorAPI —np.random.default_rng()replaces the legacy global state.