Guide 12 · Data Science and Machine Learning

NumPy, Deep Dive

The mental shift from looping to thinking in arrays, including the shape errors and how to read them.

Planned 14 notebooks 0 written

Before this guide: Python from the Start.

The notebooks

None of these notebooks is written yet. This is the plan, in reading order.

1Why NumPyThe loop you are about to stop writingnot yet written
2Creating ArraysFrom lists, and with zeros, arange and linspacenot yet written
3dtypeint64, float64, and the silent overflow that ate your numbernot yet written
4ShapeDimensions, reshape, and what -1 meansnot yet written
5Indexing and SlicingAnd the view that shares memory with the array you slicednot yet written
6Boolean MasksFiltering an array without writing a loopnot yet written
7Fancy IndexingIndex arrays, and knowing when you got a copynot yet written
8BroadcastingThe rules, and how to read the shape error you just gotnot yet written
9Vectorized MathUniversal functions, and elementwise thinkingnot yet written
10Aggregationsum, mean, min, max, and what they collapsenot yet written
11The axis ArgumentThe single most misunderstood parameter in the librarynot yet written
12Random NumbersGenerator, seeds, and results somebody else can reproducenot yet written
13Linear Algebramatmul, solve, the @ operator, and least squaresnot yet written
14PerformanceWhy vectorized is faster, measured rather than assertednot yet written