Working with Data: NumPy and pandas
Arrays, vectors, broadcasting, tables and charts: the two libraries under almost all data science and machine learning, and the maths behind embeddings.
What this phase relies on. Lists, tuples and dictionaries (Phase 4), functions and arguments (Phase 5), import and installing packages (Topics 6.1 and 6.5), and reading error messages (Topic 7.1). Topic 14.8 also uses dates (Topic 7.11) and CSV text (Topic 7.7). If you skipped those phases, go back to them first, or read each "Recall" line in this phase and follow its topic number. You do not need any maths beyond school arithmetic: every maths word (vector, matrix, dimension, axis, mean, standard deviation, dot product) is explained in everyday terms where it first appears.
Plain Python lists are flexible but slow for numbers. NumPy gives Python a fast, fixed-type array, and nearly every AI library (scikit-learn, PyTorch, the tools that store embeddings) is built on its ideas. This phase teaches arrays from the first line: shape, indexing, slices that share memory, boolean masks, broadcasting and random numbers you can repeat.
Then it turns to the maths that AI actually runs on: vectors, dot products, cosine similarity and matrix multiplication. You will build a small similarity search over embeddings and see a neural-network layer as one line, X @ W + b. Topic 16.8 builds on this base.
The second half is pandas, the library for tables. You will load a CSV, clean missing values, duplicates, text and dates, group, join and reshape data, and meet the wider ecosystem (Matplotlib, Polars, DuckDB, Arrow, Parquet). The browser here runs NumPy 2.2 and pandas 2.3. Every runnable example is repeatable: random numbers come from a seeded generator and tables are built from literal text.
Practise this phase
Hands-on exercises: write the code, run it, and press Check to have it tested automatically.