socceraction.spadl.statsbomb.convert_to_actions

socceraction.spadl.statsbomb.convert_to_actions(events, home_team_id, xy_fidelity_version=None, shot_fidelity_version=None)

Convert StatsBomb events to SPADL actions.

Parameters:
  • events (pd.DataFrame) – DataFrame containing StatsBomb events from a single game.

  • home_team_id (int) – ID of the home team in the corresponding game.

  • xy_fidelity_version (int, optional) – Whether low or high fidelity coordinates are used in the event data. If not specified, the fidelity version is inferred from the data.

  • shot_fidelity_version (int, optional) – Whether low or high fidelity coordinates are used in the event data for shots. If not specified, the fidelity version is inferred from the data.

Returns:

actions – DataFrame with corresponding SPADL actions.

Return type:

pd.DataFrame