Skip to main content

Function: corsi_fenwick()

corsi_fenwick(pbp): Row[]

Defined in: src/analytics/hockeytech.ts:790

Team-level shot-attempt counts, one row per non-null team_id: CF/CA/CF%, FF/FA/FF% and corsi_includes_missed = false. Teams come out in first-seen order.

Parameters​

pbp​

Row[]

Event rows with event and team_id. Corsi events are shot, blocked_shot, goal; Fenwick events are shot, goal. Rows with a null team_id are ignored.

Returns​

Row[]

One row per distinct team: team_id (as found in the input), corsi_for, corsi_against, corsi_for_pct (null when CF + CA is 0), fenwick_for, fenwick_against, fenwick_for_pct, corsi_includes_missed (always false). [] for an empty input.

Example​

import { corsi_fenwick } from "sportsdataverse/dist/analytics/hockeytech.js";
const teams = corsi_fenwick(enrichedPbp); // two rows for a normal game

Remarks​

"Against" counts every other non-null team's attempts, so the two rows of a game mirror each other. The HockeyTech feed has no missed-shot event, so these are proxies. Note the goal + twin shot rows from parse_pbp both count unless you dedupe on is_goal_twin first. Py's output row order is undefined; here it is first-seen.