The same six numbers stored two ways: a Python list keeps pointers to separately-boxed objects scattered in memory, so summing chases one pointer per value to a random address; a NumPy array packs the raw values back-to-back in one block, so summing walks straight through memory with zero random jumps. Speed comes from the packed, single-type layout.

Why an array, not a list

Same six numbers, two memory layouts. A Python list holds pointers to objects scattered elsewhere; a NumPy array packs the raw values back-to-back. Watch what reading them costs.

python list — pointers to boxed objects

↓ each slot points off to a separate object, somewhere in memory

random jumps0one pointer-chase per value
sum0 

numpy array (int64) — one packed block

int64 · 8 bytes/cell · element i at base + 8·i

↓ values sit back-to-back; reading them is one straight sweep

random jumps0sequential — stays local
sum0 

The speed is not magic: packed + single-type means a predictable stride and no per-element object to unpack — so the array walks straight through memory, while the list chases a pointer to a random address for every single value.