Hockey & Cross-League Projects
Three NHL builds — shots, leaders, form — then the capstone: measuring home advantage across five leagues at once.
A short project course. Three NHL builds cover the working rhythm of hockey data — plot shot locations on a rink you draw yourself, chart the scoring leaders, track team form as a rolling time series — using the NHL's keyless public API with bundled offline samples.
Then the capstone widens the lens: one analysis, five leagues, asking whether home advantage is a constant of team sports or a local custom. It's the site's best example of a question you can only answer because you learned to pull all the data sources.
What you'll be able to do
- Pull and plot NHL shot and scoring data on a rink you render
- Read team form with rolling goal differential
- Run one method across five leagues and compare like with like
The bundle contains each part's finished script, the shared helpers, and the sample data they read, with a README listing the run order - the whole course works offline.
The syllabus
Pace: Four sittings, in order - the capstone assumes the pull skills from the other courses.
0 of 4 parts marked complete on this device.
Every part of this course is marked complete on this device. The capstone below is the victory lap - and the quiz will tell you if anything slipped.
- Build a Shot-Location Plot for an NHL TeamDraw the rink, place real shots - hockey's canvas chart.
- Build an NHL Goal-Scoring Leaders ChartFrom raw pull to a publishable leaders chart.
- Track a Team's Form: Rolling Goal DifferentialForm as a time series - the trend behind the streak.
- Same Question, Five Sports: Quantifying Home Advantage Across LeaguesThe capstone: one method, five leagues, a real comparative answer.
Check yourself
Five questions, graded on the page, nothing recorded anywhere - pick an answer and the explanation appears.
1. Rolling goal differential smooths…
Averaging a moving window trades a little lag for a lot less noise - the trend becomes visible under the streaks.
2. Why compare home advantage across leagues as a rate rather than raw home wins?
An 82-game league piles up more raw home wins than a 38-game one regardless of advantage. Only a rate makes the comparison honest.
3. Drawing the rink to scale matters because…
'Most shots come from the slot' is a claim about real distances. A distorted rink distorts the finding.
4. The NHL's public stats API requires…
It's open - which is why this course uses it for the friendliest live pull on the site.
5. A team on a long win streak whose rolling goal differential is flat is…
Streaks built on one-goal margins are luck-heavy; the differential, not the streak length, carries the predictive signal.
Where next: Working with Real Sports APIs · Statistics for Sports Data.