Model or dataset
cfgranda/ps4ds avatar
cfgranda/ps4ds

cfgranda/ps4ds: A Notebook Course That Binds Probability to Real Datasets

Probability and Statistics for Data Science: A self-contained introduction to probability and statistics for data science, including a free pdf, 103 Python notebooks using 23 real-world datasets, 118 videos with slides, and solutions to 200 exercises

621 stars79 forksJupyter NotebookLicense varies

At a glance

What is it?
The ps4ds repository is the code companion to a probability and statistics textbook, organised as 103 Python notebooks across 23 datasets. It is a teaching corpus, not a library, and its value depends on whether you want to read statistics through worked examples rather than import it as a dependency.
Who is it for?
Adopt ps4ds if you are teaching or self-studying probability and want every concept attached to a named dataset: House votes, Durant free throws, Oxford temperatures, Mauna Loa precipitation. Do not adopt it if you need an installable statistics package, a pinned dependency, or a licence you can point a legal team at, because the repository carries no licence file and the notebooks are meant to be read and run one at a time.
Can I use it commercially?
Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
Is it still maintained?
Yes. The repository last received commits 19 days ago.
What is it written in?
Mainly Jupyter Notebook, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What ps4ds Is, and What It Is Not

ps4ds is the code repository for a book titled Probability and Statistics for Data Science. The README points to a free preprint, videos, code, slides and solutions to exercises hosted at ps4ds.net. The repository itself is a directory tree of Jupyter notebooks, grouped by the kind of random variable under discussion: probability, discrete variables, continuous variables, multiple discrete variables, multiple continuous variables, and discrete and continuous variables together. Each notebook is named after the dataset it uses, not after the technique it teaches. That naming choice tells you what the author expects: you arrive with a question about free throw streaks or Oxford temperatures, and the estimator appears because the data demands it. This is the opposite of a reference implementation, where you arrive with an estimator and look for a dataset. If you want a statistics library you can import, ps4ds is the wrong artefact. If you want to see maximum likelihood applied to a geometric model of Kevin Durant's free throws, it is exactly the right one.

The Dataset-First Organisation and Why It Matters

The README lists concrete pairings. Under discrete variables, Durant's free throw streaks carry nonparametric and parametric models, the geometric distribution and maximum likelihood. Phone calls carry nonparametric versus parametric models, the Poisson distribution and maximum likelihood. Under continuous variables, height carries cumulative distribution functions, quantiles, density estimation, box plots, the Gaussian distribution and maximum likelihood. Under multiple discrete variables, precipitation in Oregon, Hawaii and Rhode Island carries joint, marginal and conditional distributions plus independence and conditional independence, while a separate notebook on precipitation time series covers Markov chains and stationarity. The pattern is that a single dataset is revisited under several headings, so the same numbers reappear as a histogram, then as a fitted parametric model, then as a conditional distribution. That repetition is pedagogically deliberate. It also means the notebooks are not independent modules. If you copy one out of the tree, you lose the context that made the concept land. The repository layout is the syllabus.

Running a Notebook: What the Material Actually Specifies

The material does not include an environment file, a requirements list, or installation instructions. What it does give is a set of direct notebook paths on the main branch, for example probability/US_congress_votes.ipynb, discrete_variables/free_throw_streaks_Durant.ipynb, continuous_variables/oxford_temperatures.ipynb, and multiple_discrete_variables/markov_chain_precipitation.ipynb. The practical route is to clone the repository and open a notebook in Jupyter. Because no dependency manifest is published in the README, the imports inside each notebook are the only specification of what you need. Treat the first execution of any notebook as a dependency discovery step rather than a given. The README does not state whether datasets are bundled in the repository or fetched at runtime, so verify that before you plan a classroom session around it. A notebook that downloads a file at execution time behaves differently on a locked-down network than one that reads a local CSV. That distinction is not answered by the supplied material, and it is the first thing to check.

The Monte Carlo Thread and the Simulation Notebooks

A distinct cluster of notebooks uses simulation rather than observation. The 3x3 basketball Olympics tournament, the boxing championship exercise and a videogame exercise are all labelled Monte Carlo method. Later, simulating an exponential covers inverse transform sampling, simulating a lake covers inverse-transform sampling with dependence between random variables, and simulating a triangle appears under multiple continuous variables. These notebooks do not estimate from data. They generate data from a specified distribution and then study the result, which is the cleanest way to show why an estimator behaves as it does. The trade-off is that simulated examples can hide the messiness that makes real analysis hard. The repository handles this by pairing them with observational counterparts: fair die rolls sit next to die rolls from real data, and simulated free throws sit next to Durant's actual streak record. That pairing is the strongest structural decision in the whole repository, because it lets a reader see the same estimator under controlled and uncontrolled conditions.

Where the Material Runs Thin

The README is a table of contents, not documentation. There is no stated Python version, no dependency list, no runtime estimate, and no note on which notebooks are prerequisites for others. The licence field is unknown, which is a real constraint rather than a formality: without a licence file you do not have an explicit grant to redistribute the notebooks, reuse the code in a commercial course, or repackage the datasets. The free preprint, videos, slides and exercise solutions live at ps4ds.net, and the terms attached to those are separate from anything in the repository. Another limitation is scale. A notebook that walks through kernel density estimation step by step is a good teaching object and a poor production reference. If you need a maintained implementation of kernel density estimation with tests and versioning, this repository will not provide it, and it does not claim to. Finally, the exercise solutions are hosted off-repository, so anyone working through the 200 exercises without network access to ps4ds.net is working without the answer key.

How It Differs From a Statistics Library or a MOOC

The nearest comparison is not another repository but a different kind of artefact. A library such as scikit-learn gives you fit and predict methods with documented parameters and a stable API; you supply the data and read the docstring when you need a detail. ps4ds inverts that relationship. The data comes first, the method is derived in the notebook, and nothing is exposed as a reusable function you can call from a script. A MOOC inverts it differently: the video comes first, the notebook is homework, and the sequence is fixed by the course calendar. ps4ds is closer to a lab manual. The 118 videos with slides and the 103 notebooks are parallel representations of the same material, and the README presents them as options rather than a required path. That is a genuine difference in approach. You can read the free PDF, watch a video, or run a notebook, and the repository does not enforce an order. The cost of that freedom is that nothing tells you where to start.

Maintenance Signals and What They Do Not Tell You

The repository is not archived, and the last push date is 2026-08-27. No releases have been retrieved, which is consistent with a course-materials repository: there is nothing to version and nothing to install, so a release would carry no meaning. The primary language is Jupyter Notebook, which means diffs are large and review is awkward, and that is a property of the format rather than a criticism of the author. The topics list course-materials, textbook, teaching-materials and statistics-course alongside data-science and machine-learning, and that ordering is honest about intent. The maintenance burden for a user is not upgrades in the usual sense. There is no version to pin and no breaking change to track. The cost is that if a dataset URL moves or a library changes its default behaviour, the notebook fails at execution time, and you are the one who has to fix it. Budget for that if you plan to reuse these notebooks in a course across several terms.

Who Should Open This Repository First

The clearest fit is an instructor building a probability course who wants every abstract concept anchored to a named dataset, and a self-learner who prefers to derive an estimator from data rather than read its definition. The 200 exercises with solutions and the 118 videos give those readers a full loop: read, watch, run, check. The clearest misfit is a team looking for a statistics dependency to import, and anyone who needs an unambiguous licence before touching the code. A second misfit is a reader who wants a single linear path, because the repository offers a tree and no recommended traversal. If you fall into the first group, start with discrete_variables/free_throw_streaks_Durant.ipynb and continuous_variables/height_distribution.ipynb, since the README attaches the longest concept lists to both, and confirm the data loading works before you build a syllabus around them.

Editorial conclusion

Adopt ps4ds if you are teaching or self-studying probability and want every concept attached to a named dataset: House votes, Durant free throws, Oxford temperatures, Mauna Loa precipitation. Do not adopt it if you need an installable statistics package, a pinned dependency, or a licence you can point a legal team at, because the repository carries no licence file and the notebooks are meant to be read and run one at a time. Before committing, open two notebooks from different directories, confirm the data loading path works on your machine, and check the ps4ds.net page for the terms attached to the free preprint.

Official sources

  1. cfgranda/ps4ds on GitHub
  2. Issues
  3. Project website
  4. README
Community notes

Community notes