About this wiki

A working wiki on quantitative research, pandas and honest validation.

print(Purple) is a personal working wiki on quantitative research and data analysis. It grew out of a habit of writing down, in one place, the handful of pandas idioms, validation rules and sanity checks that a small research question on an unfamiliar table actually needs. Most pages are short and answer one question. The case studies are longer and show the whole process on public data, including the studies that found nothing.

Why the name

print() is still the most honest debugger there is. It shows what a variable actually holds, not what you assumed it held, and it is the first thing worth typing when a number looks too good. Every result on this site got here the same way: printed by code that ran, and pasted from the output. The colour is just the colour.

Principles

  • Base stack first. The primary version of every snippet uses only pandas, numpy, scikit-learn and matplotlib. Where statsmodels or scipy would be nicer, that version follows, labelled as optional.
  • Portable by default. Code is written to the subset of Python and pandas that behaves the same across releases, because analysis code travels between machines and the newest syntax is the first thing to break. See portable pandas and Python idioms.
  • Every snippet runs. Before a page is published, every Python block on it is executed, in order, in a pinned environment against the dataset the page names. A snippet that errors costs more than no snippet.
  • No fabricated results. A number appears on a case-study page only if the code on that page produced it. Where a result is unverified it says so or is left out.
  • Hold-outs are reported once. Chronological splits with an embargo, choices made on the training period, one look at the hold-out. Everything tried is counted.

Verification

The current build executed 223 code blocks across 52 pages on 2026-09-28. Pages that pass show a green tick in their header.

The harness lives in the repository as verify/verify_snippets.py. It extracts fenced Python blocks from each page, runs them sequentially in a shared namespace per page, and fails the build if any block raises. Blocks that intentionally show a broken pattern are marked to be skipped, and say so in the text next to them.

Data

Every dataset is public and is fetched by a script in the repository from a documented source, so every page can be re-run from scratch. The equity case studies use a five-year daily OHLCV file for S&P 500 constituents (all_stocks_5yr.csv, 619,040 rows, 505 tickers, 2013-02-08 to 2018-02-07) from theplotly/datasets repository, and the taxi study the 6,433-row New York taxi sample distributed with seaborn. The other case studies use datasets from theUCI Machine Learning Repository (bike sharing, Tetouan power consumption, Parkinson's telemonitoring, bank marketing, metro interstate traffic, Beijing multi-site air quality), the hotel-booking demand data published with Antonio, de Almeida and Nunes (2019), the nycflights13flights and weather tables, and the Ames housing data published with De Cock (2011). Each case study names its file, its source and its licence; the manifest with URLs and retrieval details is verify/datasets.json.

Site

Static HTML built with Astro. Client-side search over a build-time index. Dark mode. KaTeX for maths. No backend, no cookies, no analytics.