First principles of pragmatic data science.
Unless a file says otherwise, the book's prose, figures, and other literary material are © 2026 Johannes Naylor and licensed under CC BY-NC-SA 4.0. This allows noncommercial sharing and adaptation with attribution, provided adaptations use the same license.
The reusable implementation in src/dsft/, the test suite, and code snippets
in the book are licensed under the MIT License.
See the directory tree in this repo. Key idea: src/dsft/ is the real,
tested "from scratch" code library — chapters import from it
(from dsft.distributions import ...) instead of re-pasting code block to
block. tests/ exists to catch overclaimed results in the prose, not just
bugs in the code. notebooks/scratch/ is for messy exploration only —
nothing there ships in the book.
uv sync
uv run pytest
uv run quarto preview # requires Quarto installed separately
uv run quarto render # screen-reading PDF (one-sided)
uv run quarto render --profile print # print PDF (two-sided `scrbook` layout)- Prototype an idea in
notebooks/scratch/until it works. - Move the real implementation into the right
src/dsft/module. - Write a test in
tests/for anything about to be stated as fact in prose. - Write the chapter in
book/part-N-.../NN-chapter-name.qmd, importing fromdsftrather than re-pasting code. uv run quarto previewto see it rendered with the rest of the book.