Skip to content

Repository files navigation

Data Science from the Tails

First principles of pragmatic data science.

License

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.

Structure

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.

Setup

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)

Workflow

  1. Prototype an idea in notebooks/scratch/ until it works.
  2. Move the real implementation into the right src/dsft/ module.
  3. Write a test in tests/ for anything about to be stated as fact in prose.
  4. Write the chapter in book/part-N-.../NN-chapter-name.qmd, importing from dsft rather than re-pasting code.
  5. uv run quarto preview to see it rendered with the rest of the book.

Contributors

Languages