Note
Go to the end to download the full example code.
Set-piece report card
The “hero” figure: one team’s corner delivery map, end-zone heatmap, and
attempts/success-rate comparison against their opponent, combined into a
single shareable image with plot_dashboard().
from pathlib import Path
from wa_setpieces import delivery_locations, load_matches
from wa_setpieces.viz.plots import plot_dashboard
try:
_here = Path(__file__).resolve().parent
except NameError:
_here = Path.cwd()
DATA = _here.parent / "tests" / "data" / "sample_match.json"
events = load_matches(DATA)
corners = delivery_locations(events, "corner")
team_id = corners["contestantId"].value_counts().idxmax()