How to Use This Book

This book is long — forty chapters, each a substantial piece of work — and it is meant to be used in different ways by different readers. A fan can read it like a long-form cricket book, skimming the code. A student can work through it like a course, running every script. A franchise analyst can jump straight to valuation and auction strategy. This page explains how the book is built so that you can choose your own way through it. For ready-made routes, see Learning Paths.

The shape of the book: eight parts, forty chapters

The book moves from foundations to description, then to prediction, then to decisions, and finally to applications and synthesis. Each part opens with a short overview.

Part Chapters What it covers
I. Foundations 1–7 Why cricket needs analytics; where the data comes from; Python and pandas from the first line; why traditional statistics mislead; the three formats as three sports; statistical thinking and small samples; visualising a match
II. Batting Analytics 8–13 Metrics beyond the average; batting impact and win-probability added; Test batting and survival; batter-versus-bowler matchups; partnerships; valuing IPL batters against their auction prices
III. Bowling and Fielding Analytics 14–18 Bowling beyond economy and expected wickets; pitch maps and ball-tracking methods; Test bowling, spells and conditions; fielding; spin against pace
IV. Match and Team Analytics 19–23 Expected runs and the match as a state space; win-probability models; team balance and the all-rounder premium; toss, venue and conditions; the DLS method
V. Prediction and Forecasting 24–29 Pre-match prediction; projecting next season; translating performance across leagues and into women's cricket; in-match forecasting; tournament simulation; session-level forecasting in Tests
VI. Strategic Analytics 30–34 Batting order; bowling rotation and the death overs; field placement; the declaration; IPL auction strategy
VII. Betting, Fantasy, and Applications 35–38 Betting markets and calibration; fantasy cricket; broadcasting and data storytelling; building a career in cricket analytics
VIII. Synthesis 39–40 The capstone platform you assemble from everything you built; the future of cricket analytics

Parts I to III are descriptive: they teach you to measure cricket properly. Parts IV and V are predictive: they teach you to forecast it. Part VI is prescriptive: it asks what a captain, coach or franchise should do. Part VII applies all of it to the industries that surround the game, and Part VIII brings it together.

The chapters build on each other, but not in a single line. Part I is the foundation for everything; after that, many chapters can be read in a different order. Each chapter's opening routing notes and its "What's Next" section tell you which earlier chapters it leans on.

The seven files in every chapter

Every chapter is a folder containing seven documents, plus a folder of code and a folder of figures:

File What it is
index.md The chapter itself — the main text, with code, outputs, figures and in-text exercises
exercises.md Graded exercises, from recall (⭐) through calculation and code to open-ended research (⭐⭐⭐⭐)
quiz.md A short self-test with answers, to check you have the core ideas
case-study-01.md A worked case study on a real match, player, team or market
case-study-02.md A second case study, often from a different format or from women's cricket
key-takeaways.md A one-page summary to revisit before moving on or before an exam
further-reading.md Annotated pointers to books, papers and data sources
code/ Every script used in the chapter, numbered in the order the chapter uses them, plus project_checkpoint.py
images/ The figures the scripts produced

Inside index.md, the pattern is consistent. A chapter opens with a hook — a real match, a real argument, a real number — followed by routing notes for the learning tracks it serves. Each numbered section opens with the cricket question it answers, in bold, before any formula or code. The chapter ends with a Project Checkpoint (the piece of the progressive project it adds), a Chapter Summary and a What's Next section that points to the following chapter.

Selected answers to exercises are collected in Appendix I; every formal metric the book defines is gathered in the metric encyclopedia, Appendix C; and the glossary, Appendix H covers both cricket and statistical terms.

The callouts

Recurring boxes in the text are marked with icons so you can scan for what you need.

Routing (at the start of each chapter) — two or three of the five learning tracks, telling readers on that track what to focus on:

  • 🏏 Fan Track — the cricket argument; what to read closely and what you can skim.
  • 📊 Analyst Track — which scripts to run and which methods to master.
  • 🎰 Betting Track — what matters for pricing, probability and calibration.
  • 🏆 Fantasy Track — what matters for projecting points and picking players.
  • 🧑‍💼 Franchise Track — what matters for selection, valuation and strategy.

Learning callouts (throughout each chapter):

  • 🔄 Check your understanding — two or three quick questions roughly every few pages. The answers are folded away under "Answer"; try first, then open.
  • 🧩 Productive struggle — a problem posed before the method that solves it. Have a go even if you get stuck; the struggle is what makes the method stick.
  • 🔍 Why this works — the reasoning behind a method, for readers who want more than the recipe.
  • 📋 Try it — a hands-on exercise with real inputs and a worked answer folded away. Each has a type: Analyze this match, Build this metric, Evaluate this player, Predict this match, Optimize this strategy or Settle this debate.
  • 🏏 Eye test — what a coach or player would see that the data misses, or what the data shows that the eye reliably misses.
  • ⚠️ Common pitfall — a mistake analysts (and commentators) make often, and how to avoid it.
  • 📐 Definition — the formal definition of a metric, stated once and used identically everywhere.
  • 🧪 Simulated data — this analysis uses the book's simulated ball-tracking layer: real outcomes, simulated locations. Never read these numbers as facts about real players.
  • 🔷 R corner — the same idea in R, for readers who use it. These short snippets are not run as part of the book's build; Appendix J introduces R properly.
  • 📊 Figure (described) — a plain-language description of the figure above it: what it shows and the takeaway, for readers who cannot see the image or are reading in a text-only format.
  • 🪞 Learning check-in — every third chapter (3, 6, 9 and so on to 39), a short pause to reflect on what you have learned and adjust how you are studying.
  • 🚪 Threshold concept — an idea that, once understood, changes how you see everything after it. There are five: small samples and regression to the mean (Chapter 6), value as change in win probability (Chapter 9), the match as a state space (Chapter 19), calibration (Chapter 20), and true ability versus observed performance (Chapter 25).

The four anchor examples

Every chapter uses real players and matches, but four examples return again and again. They are the book's spine, and each one is introduced in Chapter 1.

Anchor A — The turning point (win probability). South Africa v Sri Lanka, third T20 international, Newlands, Cape Town, 25 January 2017. Chasing 170, Sri Lanka were 116/2 after fifteen overs. Imran Tahir's sixteenth over cost two runs and removed both set batters. Seekkuge Prasanna then made 37 not out off 16 balls, and Sri Lanka won by five wickets with a ball to spare. How much did each over change the result? You will build a simple win-probability model to answer that in Chapter 9 and a full one in Chapter 20, and the curve you draw will tell the story of the match in one picture.

Anchor B — The auction inefficiency (Moneyball for the IPL). Using real auction prices from 2022 to 2026 and real ball-by-ball performance, the book looks for an expensive player whose phase-specific value lags behind a much cheaper player's. The pair is revealed in Chapter 13 — no invented "Player X", and if the cleanest real pair the data offers is imperfect, the chapter says so — and Chapter 34 turns the method into a full auction strategy.

Anchor C — The batting-average illusion (cause and effect). Rohit Sharma averages 58.46 in ODIs that India won and 36.01 in ODIs they lost. Does he "perform in wins", or do India win because he scores? Splitting a player's record by the match result builds the result into the statistic. This trap, called selection on the outcome, appears in Chapters 1, 4, 6 and 9.

Anchor D — The matchup that wins a semi-final. Quinton de Kock's record against off-spin in men's T20 cricket is genuinely weaker than his record against everything else — but how much weaker, once the small samples are handled honestly? Chapter 11 finds the matchup and teaches the shrinkage that makes it believable; Chapter 31 asks how a captain should plan the bowling to exploit it.

The recurring cast

Five fictional characters appear in hooks, short dialogues and Project Checkpoints. They are composites, invented for the book. None of them works for a real franchise, board or company, they never meet or quote real players, and their "data" is always the book's real dataset.

  • Nusrat Jahan, 22, a statistics undergraduate in Dhaka and a lifelong Bangladesh fan, with an old laptop and a slow connection. She is the reader's stand-in: she builds the progressive project chapter by chapter and asks the questions a sharp beginner asks.
  • Wendell Baptiste, 58, a Trinidadian former first-class seamer who now coaches the Port of Spain Pelicans, a fictional academy T20 side. He is the voice of the eye test — sceptical, funny and often right.
  • Kavya Subramanian, 31, a Chennai-born data journalist and broadcast graphics producer at The Long Room, a fictional digital outlet. She appears where analysis meets the audience.
  • Tom Ashworth, 44, a former quantitative analyst at an unnamed UK sportsbook who now teaches risk. He is the sober, ethics-first voice of the betting chapter.
  • Imran Qureshi, 37, Lahore-born, who runs analytics for Headingley Road CC, a fictional club side in Leeds. He speaks for Test and red-ball cricket, English conditions and the Dukes ball.

The progressive project: Crease

Across the book you build Crease, a cricket analytics platform — a small, open, do-it-yourself version of the dashboards broadcasters and franchises use. It is a Python package in project/crease/. From Chapter 2 onward, almost every chapter adds one module: data loading in Chapter 2, traditional statistics and their diagnostics in Chapter 4, phase batting profiles in Chapter 8, a first win-probability model in Chapter 9, matchups with shrinkage in Chapter 11, expected wickets in Chapter 14, a full win-probability model in Chapter 20, a pre-match model in Chapter 24, a tournament simulator in Chapter 28, an auction value model in Chapter 34, and so on.

Each chapter's code/project_checkpoint.py demonstrates the new module on real data. In Chapter 39 the modules come together as an interactive dashboard with tests, and Chapter 38 helps you turn what you have built into a portfolio. You can follow the project chapter by chapter, or treat the finished modules in project/crease/ as a library and use them directly.

Reading code, reading output

The book shows two kinds of fenced block, and the difference matters.

A code block is labelled Python and shows the key lines of an analysis:

from cricdata import load_deliveries, batting_summary

balls = load_deliveries("ipl")                 # one row per delivery, 2008-2026
balls = balls[~balls["super_over"]]            # super overs are not part of careers
career = batting_summary(balls).loc[["V Kohli", "SA Yadav"]]
print(career[["runs", "balls", "outs", "average", "strike_rate"]])

In the chapter text, code blocks usually show ten to forty lines — the part worth reading — rather than whole files. A line such as "Full script: code/02_kohli_vs_sky.py" tells you where the complete, runnable version is.

An output block is plain text and shows exactly what a script printed when it was run against the book's data snapshot:

          runs  balls  outs  average  strike_rate
batter                                           
V Kohli   9336   6926   231    40.42       134.80
SA Yadav  4581   3083   136    33.68       148.59

Output is never typed in by hand or tidied into a nicer-looking number. If you run the same script on the same snapshot, you get the same output. (If you refresh the data with newer matches, the numbers will move a little — see About the Data.) Occasionally a long output is shortened with an ellipsis line; nothing else is edited.

Every figure is produced by a script in the chapter's code/ folder and saved to images/. Below each figure, a 📊 Figure (described) note states what it shows in words.

Python is taught from scratch in Chapters 2 and 3, and every new pandas idiom is explained on first use up to Chapter 8. From Chapter 9 onward the book assumes Part I. Appendix A is a reference for the Python and pandas you need, and Appendix B documents every column and every toolkit function.

Reading without code

You can read this book without running a line of code, and many readers will. The prose carries the whole cricket argument: every table the code produces is printed in the text, every figure is shown and described, and every conclusion is stated in words. If you skip the code blocks entirely, you lose the ability to rerun and extend the analyses, but not the analyses themselves.

If you are reading without code:

  • Read the hook, the cricket question that opens each section, the output tables and the figures. Treat code blocks as recipes you can glance at to see what was computed.
  • Do the 🔄 Check your understanding questions and the 📋 Try it exercises marked Settle this debate or Analyze this match — most can be done with the printed numbers and a calculator.
  • In exercises.md, the conceptual and calculation parts need no code; each chapter's exercise page says which parts suit which track.
  • Skip the Project Checkpoints, or read them as a description of what a working analyst would build.

Conventions

  • Formats are always named. "Strike rate" in a T20 sentence means T20 strike rate; nothing is compared across formats without saying so.
  • Phases use one-based over numbers. T20: powerplay 1–6, middle overs 7–15, death 16–20. ODI: powerplay 1–10, middle 11–40, death 41–50. The Hundred: balls 1–25, 26–75, 76–100. Tests have no phases.
  • Definitions are fixed. A batting average is runs off the bat divided by dismissals (excluding "retired hurt" and "retired not out"); a ball faced excludes wides but includes no-balls; a bowler's runs conceded include wides and no-balls but not byes or leg-byes. Every chapter uses the same functions, so a number means the same thing in Chapter 4 as in Chapter 34.
  • "Batter" is used throughout, following the MCC Laws since 2021; "batsman" survives only in quoted historical usage and a few chapter titles.
  • Money in the IPL is given in rupees: ₹1 crore = 100 lakh = ten million rupees. US dollar equivalents, where given, are rough context only.
  • Player names appear as Cricsheet spells them in code and output ("V Kohli", "SA Yadav", "RG Sharma") and in full in the prose.
  • Dates of the data: "through November 2026" or "through the 2026 IPL season" means the snapshot described in About the Data.

A suggested rhythm for each chapter

  1. Read the hook and the routing note for your track.
  2. Read each section, attempting the 🧩 Productive struggle and 🔄 Check your understanding questions before opening the answers.
  3. If you are running code, run each script as the chapter reaches it — python code/01_...py from the chapter's folder — and compare your output with the book's.
  4. Do at least two 📋 Try it exercises.
  5. Read key-takeaways.md, take the quiz, and pick exercises from exercises.md.
  6. If you are building Crease, run code/project_checkpoint.py and make sure it works before moving on.

That is the whole machine. The rest is cricket.