Free & Open Source

The Ultimate Guide to Soccer Analytics

Master football analytics with R and Python. From traditional statistics to cutting-edge expected goals (xG) and tracking data, learn the exact skills used by professional clubs, scouts, and analysts worldwide.

60
Chapters
280+
Sections
900+
Code Examples
55+
Exercises
analysis.py
# Get free StatsBomb match data
from mplsoccer import Pitch
import pandas as pd
from statsbombpy import sb

# World Cup 2022 Final: Argentina vs France
matches = sb.matches(competition_id=43, season_id=106)
events = sb.events(match_id=3869685)

# Calculate xG by team
shots = events[events['type'] == 'Shot']
xg_summary = shots.groupby('team').agg({
    'shot_statsbomb_xg': 'sum',
    'shot_outcome': lambda x: (x == 'Goal').sum()
})

print(xg_summary)
# Argentina: 2.77 xG, 3 Goals
# France:    2.44 xG, 3 Goals

Why Choose This Textbook

Everything you need to master soccer analytics

Dual Language Coverage

Side-by-side R & Python code for every concept. Toggle between languages with a single click. Learn best practices for each language.

Expected Goals (xG) Era Analytics

Modern tracking data examples, xG, xA, xGChain, xGBuildup. Pressing & possession analytics using industry-standard metrics.

Career-Ready Skills

Industry-standard methods used by professional clubs. Portfolio project ideas and dedicated career guidance chapter.

Machine Learning

Player similarity models, match outcome prediction, recruitment optimization. From basic regression to neural networks.

Interactive Visualizations

Pitch plots with mplsoccer, pass networks & heat maps, shot maps, touch maps, and radar charts for player comparison.

Global Coverage

Premier League, La Liga, Serie A, Bundesliga, Ligue 1, MLS, FIFA World Cup, Champions League, and women's football analytics.

Your Learning Journey

A structured path from beginner to expert

1

Foundations

Chapters 1-5

R/Python basics, data wrangling, accessing soccer data sources. Set up your environment and build your first visualizations.

2

Core Analytics

Chapters 6-12

Traditional stats, xG models, passing analytics, defensive metrics. Master the fundamental metrics used in professional analysis.

3

Advanced Methods

Chapters 13-30

Tracking data, ML models, custom metrics, pitch control. Build sophisticated models like the pros.

4

Applied Topics

Chapters 31-60

Positional analysis, scouting, tactics, business analytics. Apply your skills to real-world scenarios.

Who Is This For?

Whether you're a fan or professional, there's something for you

📈

Aspiring Analysts

Launch your career in football analytics

Fantasy Players

Gain an edge with data-driven decisions

🎓

Students

Apply data science to sports

📝

Journalists

Tell compelling data stories

🔎

Scouts

Find hidden gems with analytics

Passionate Fans

Understand the game deeper

Ready to Master Soccer Analytics?

Join thousands learning to analyze the beautiful game with data.

Start Learning Now