Vectorization, broadcasting, axes, views vs copies, loc and iloc, filtering, groupby and merge, missing data, dates and performance, with memory-layout and DataFrame diagrams.
Why is NumPy so much faster than a Python loop over lists?
Tap to flip
Back
A ndarray stores values of one dtype in one contiguous block of memory, and operations run as compiled C loops (often using SIMD) over that block. A Python list stores pointers to separate Python objects and executes interpreted bytecode per element. Writing a * 2 instead of [x * 2 for x in a] is called vectorization.