diff --git a/docs/examples/broadcast_tracking_data.ipynb b/docs/examples/broadcast_tracking_data.ipynb
deleted file mode 100644
index 09aaaa55..00000000
--- a/docs/examples/broadcast_tracking_data.ipynb
+++ /dev/null
@@ -1,432 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Broadcast Tracking Data\n",
- "\n",
- "Unlike tracking data from permanently installed camera systems in a stadium, broadcast tracking captures player locations directly from video feeds. \n",
- "As these broadcast feeds usually show only part of the pitch, this tracking data contains only part of the players information for most frames and may be missing data for some frames entirely due to playbacks or close-up camera views. \n",
- "For more information about this data please go to https://github.com/SkillCorner/opendata.\n",
- "\n",
- "A note from Skillcorner: \n",
- "\"if you use the data, we kindly ask that you credit SkillCorner and hope you'll notify us on Twitter so we can follow the great work being done with this data.\"\n",
- "\n",
- "Available Matches in the Skillcorner Opendata Repository: \n",
- "\n",
- " \"ID: 4039 - Manchester City vs Liverpool on 2020-07-02\" \n",
- " \"ID: 3749 - Dortmund vs Bayern Munchen on 2020-05-26\" \n",
- " \"ID: 3518 - Juventus vs Inter on 2020-03-08\" \n",
- " \"ID: 3442 - Real Madrid vs FC Barcelona on 2020-03-01\" \n",
- " \"ID: 2841 - FC Barcelona vs Real Madrid on 2019-12-18\" \n",
- " \"ID: 2440 - Liverpool vs Manchester City on 2019-11-10\" \n",
- " \"ID: 2417 - Bayern Munchen vs Dortmund on 2019-11-09\" \n",
- " \"ID: 2269 - Paris vs Marseille on 2019-10-27\" \n",
- " \"ID: 2068 - Inter vs Juventus on 2019-10-06\"\n",
- "\n",
- "Metadata is available for this data.\n",
- "\n",
- "## Loading Skillcorner data\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 1,
- "metadata": {
- "scrolled": true
- },
- "outputs": [],
- "source": [
- "from kloppy import skillcorner\n",
- "\n",
- "# there is one example match for testing purposes in kloppy that we use here\n",
- "# for other matches change the filenames to the location of your downloaded skillcorner opendata files\n",
- "matchdata_file = '../../kloppy/tests/files/skillcorner_match_data.json'\n",
- "tracking_file = '../../kloppy/tests/files/skillcorner_structured_data.json'\n",
- "\n",
- "dataset = skillcorner.load(meta_data=matchdata_file,\n",
- " raw_data=tracking_file,\n",
- " limit=100)\n",
- "\n",
- "df = dataset.to_df()"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Exploring the data\n",
- "\n",
- "When you want to show the name of a player you are advised to use `str(player)`. This will call the magic `__str__` method that handles fallbacks for missing data. By default it will return `full_name`, and fallback to 1) `first_name last_name` 2) `player_id`."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 2,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "['Thiago Alcantara (6)',\n",
- " 'Lukas Mai (33)',\n",
- " 'David Alaba (27)',\n",
- " 'Manuel Neuer (1)',\n",
- " 'Mickael Cuisance (11)',\n",
- " 'Corentin Tolisso (24)',\n",
- " 'Thomas Müller (25)',\n",
- " 'Joshua Kimmich (32)',\n",
- " 'Sven Ulreich (26)',\n",
- " 'Robert Lewandowski (9)',\n",
- " 'Kingsley Coman (29)',\n",
- " 'Leon Goretzka (18)',\n",
- " 'Alphonso Davies (19)',\n",
- " 'Javier Martinez (8)',\n",
- " 'Benjamin Pavard (5)',\n",
- " 'Philippe Coutinho (10)',\n",
- " 'Ivan Perisic (14)',\n",
- " 'Serge Gnabry (22)']"
- ]
- },
- "execution_count": 2,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "metadata = dataset.metadata\n",
- "home_team, away_team = metadata.teams\n",
- "\n",
- "[f\"{player} ({player.jersey_no})\" for player in home_team.players]\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 3,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "home - FC Bayern Munchen\n",
- "away - Borussia Dortmund\n"
- ]
- }
- ],
- "source": [
- "print(f\"{home_team.ground} - {home_team}\")\n",
- "print(f\"{away_team.ground} - {away_team}\")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {
- "collapsed": true
- },
- "source": [
- "## Working with tracking data\n",
- "\n",
- "The actual tracking data is available at `dataset.frames`. This list holds all frames. Each frame has a `players_coordinates` dictionary that is indexed by `Player` entities and has values of the `Point` type.\n",
- "\n",
- "Identities of players are not always specified. In that case only the team affiliation is known and a track_id that is part of the player_id is used to identify the same (unknown) player across multiple frames."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 4,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Number of players in the frame: 18\n",
- "List home team players coordinates\n",
- "[('home_anon_75', Point(x=0.651772292307619, y=0.058380954035294086)),\n",
- " ('home_22', Point(x=0.5811316475035238, y=0.010450905444117642)),\n",
- " ('home_5', Point(x=0.6586107308438095, y=0.028452003889705924)),\n",
- " ('home_29', Point(x=0.5017706101333714, y=0.6315331512472059)),\n",
- " ('home_18', Point(x=0.5846745990571428, y=0.09758438650000001)),\n",
- " ('home_25', Point(x=0.5817775484115238, y=0.35925220307852945)),\n",
- " ('home_8', Point(x=0.7467174002371428, y=0.13082327161470597)),\n",
- " ('home_27', Point(x=0.7323288673171429, y=0.3728190142901471)),\n",
- " ('home_19', Point(x=0.7071614695780952, y=0.507377931049897)),\n",
- " ('home_32', Point(x=0.635410294564762, y=0.11935376853823532))]\n"
- ]
- }
- ],
- "source": [
- "first_frame = dataset.frames[88]\n",
- "print(f\"Number of players in the frame: {len(first_frame.players_coordinates)}\")\n",
- "\n",
- "from pprint import pprint\n",
- "print(\"List home team players coordinates\")\n",
- "pprint([\n",
- " (player.player_id, player_coordinates) \n",
- " for player, player_coordinates\n",
- " in first_frame.players_coordinates.items()\n",
- " if player.team == home_team\n",
- "])"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 5,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " period_id \n",
- " timestamp \n",
- " frame_id \n",
- " ball_state \n",
- " ball_owning_team_id \n",
- " ball_x \n",
- " ball_y \n",
- " ball_z \n",
- " away_23_x \n",
- " away_23_y \n",
- " ... \n",
- " away_14_d \n",
- " away_14_s \n",
- " home_9_x \n",
- " home_9_y \n",
- " home_9_d \n",
- " home_9_s \n",
- " home_anon_75_x \n",
- " home_anon_75_y \n",
- " home_anon_75_d \n",
- " home_anon_75_s \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " 1 \n",
- " 11.2 \n",
- " 1523 \n",
- " None \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " 0.747489 \n",
- " 0.098509 \n",
- " ... \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- " 1 \n",
- " 1 \n",
- " 11.3 \n",
- " 1524 \n",
- " None \n",
- " NaN \n",
- " 0.791347 \n",
- " -0.020033 \n",
- " 2.243712 \n",
- " 0.745323 \n",
- " 0.099367 \n",
- " ... \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- " 2 \n",
- " 1 \n",
- " 11.4 \n",
- " 1525 \n",
- " None \n",
- " NaN \n",
- " 0.772630 \n",
- " -0.009469 \n",
- " 2.534799 \n",
- " 0.742956 \n",
- " 0.099743 \n",
- " ... \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- " 3 \n",
- " 1 \n",
- " 11.5 \n",
- " 1526 \n",
- " None \n",
- " NaN \n",
- " 0.754625 \n",
- " 0.001612 \n",
- " 2.659813 \n",
- " 0.740386 \n",
- " 0.099638 \n",
- " ... \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- " 4 \n",
- " 1 \n",
- " 11.6 \n",
- " 1527 \n",
- " None \n",
- " NaN \n",
- " 0.737330 \n",
- " 0.013210 \n",
- " 2.618755 \n",
- " 0.737875 \n",
- " 0.096646 \n",
- " ... \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- "
\n",
- "
5 rows × 92 columns
\n",
- "
"
- ],
- "text/plain": [
- " period_id timestamp frame_id ball_state ball_owning_team_id ball_x \\\n",
- "0 1 11.2 1523 None NaN NaN \n",
- "1 1 11.3 1524 None NaN 0.791347 \n",
- "2 1 11.4 1525 None NaN 0.772630 \n",
- "3 1 11.5 1526 None NaN 0.754625 \n",
- "4 1 11.6 1527 None NaN 0.737330 \n",
- "\n",
- " ball_y ball_z away_23_x away_23_y ... away_14_d away_14_s \\\n",
- "0 NaN NaN 0.747489 0.098509 ... NaN NaN \n",
- "1 -0.020033 2.243712 0.745323 0.099367 ... NaN NaN \n",
- "2 -0.009469 2.534799 0.742956 0.099743 ... NaN NaN \n",
- "3 0.001612 2.659813 0.740386 0.099638 ... NaN NaN \n",
- "4 0.013210 2.618755 0.737875 0.096646 ... NaN NaN \n",
- "\n",
- " home_9_x home_9_y home_9_d home_9_s home_anon_75_x home_anon_75_y \\\n",
- "0 NaN NaN NaN NaN NaN NaN \n",
- "1 NaN NaN NaN NaN NaN NaN \n",
- "2 NaN NaN NaN NaN NaN NaN \n",
- "3 NaN NaN NaN NaN NaN NaN \n",
- "4 NaN NaN NaN NaN NaN NaN \n",
- "\n",
- " home_anon_75_d home_anon_75_s \n",
- "0 NaN NaN \n",
- "1 NaN NaN \n",
- "2 NaN NaN \n",
- "3 NaN NaN \n",
- "4 NaN NaN \n",
- "\n",
- "[5 rows x 92 columns]"
- ]
- },
- "execution_count": 5,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "df.head()"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "kloppy-venv",
- "language": "python",
- "name": "kloppy-venv"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.10.6"
- },
- "toc": {
- "base_numbering": 1,
- "nav_menu": {},
- "number_sections": true,
- "sideBar": true,
- "skip_h1_title": false,
- "title_cell": "Table of Contents",
- "title_sidebar": "Contents",
- "toc_cell": false,
- "toc_position": {},
- "toc_section_display": true,
- "toc_window_display": false
- }
- },
- "nbformat": 4,
- "nbformat_minor": 4
-}
diff --git a/docs/examples/code_data.ipynb b/docs/examples/code_data.ipynb
deleted file mode 100644
index a0b42f9c..00000000
--- a/docs/examples/code_data.ipynb
+++ /dev/null
@@ -1,1628 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Code data\n",
- "\n",
- "Apart from event- and tracking data analytics often use code data. This type of data can be collected by hand using tools like SportsCode. \n",
- "\n",
- "Kloppy allows easy read AND write functionallity for the codes in SportsCode XML format. "
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Reading XML file"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 1,
- "metadata": {},
- "outputs": [],
- "source": [
- "from kloppy import sportscode"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 2,
- "metadata": {},
- "outputs": [],
- "source": [
- "with open(\"file.xml\", \"w\") as fp:\n",
- " fp.write(\"\"\"\n",
- "\n",
- " \n",
- " \n",
- " P1 \n",
- " 3.6 \n",
- " 9.7 \n",
- " PASS
\n",
- " \n",
- " Team \n",
- " Henkie \n",
- " \n",
- " \n",
- " Packing.Value \n",
- " 1 \n",
- " \n",
- " \n",
- " Receiver \n",
- " Klaas Nøme \n",
- " \n",
- " \n",
- " \n",
- " P2 \n",
- " 68.3 \n",
- " 74.5 \n",
- " PASS
\n",
- " \n",
- " Team \n",
- " Henkie \n",
- " \n",
- " \n",
- " Packing.Value \n",
- " 3 \n",
- " \n",
- " \n",
- " Receiver \n",
- " Piet \n",
- " \n",
- " \n",
- " \n",
- " P3 \n",
- " 103.6 \n",
- " 109.6 \n",
- " SHOT
\n",
- " \n",
- " Team \n",
- " Henkie \n",
- " \n",
- " \n",
- " Expected.Goal.Value \n",
- " 0.13 \n",
- " \n",
- " \n",
- " \n",
- " \"\"\")\n",
- " \n",
- "code_dataset = sportscode.load(\"file.xml\")\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 3,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " code_id \n",
- " period_id \n",
- " timestamp \n",
- " end_timestamp \n",
- " code \n",
- " Team \n",
- " Packing.Value \n",
- " Receiver \n",
- " Expected.Goal.Value \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " P1 \n",
- " 1 \n",
- " 3.6 \n",
- " 9.7 \n",
- " PASS \n",
- " Henkie \n",
- " 1.0 \n",
- " Klaas Nøme \n",
- " NaN \n",
- " \n",
- " \n",
- " 1 \n",
- " P2 \n",
- " 1 \n",
- " 68.3 \n",
- " 74.5 \n",
- " PASS \n",
- " Henkie \n",
- " 3.0 \n",
- " Piet \n",
- " NaN \n",
- " \n",
- " \n",
- " 2 \n",
- " P3 \n",
- " 1 \n",
- " 103.6 \n",
- " 109.6 \n",
- " SHOT \n",
- " Henkie \n",
- " NaN \n",
- " None \n",
- " 0.13 \n",
- " \n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " code_id period_id timestamp end_timestamp code Team Packing.Value \n",
- "0 P1 1 3.6 9.7 PASS Henkie 1.0 \\\n",
- "1 P2 1 68.3 74.5 PASS Henkie 3.0 \n",
- "2 P3 1 103.6 109.6 SHOT Henkie NaN \n",
- "\n",
- " Receiver Expected.Goal.Value \n",
- "0 Klaas Nøme NaN \n",
- "1 Piet NaN \n",
- "2 None 0.13 "
- ]
- },
- "execution_count": 3,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "code_dataset.to_df()"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "The code dataset also allows filtering the codes"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 4,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " code_id \n",
- " period_id \n",
- " timestamp \n",
- " end_timestamp \n",
- " code \n",
- " Team \n",
- " Packing.Value \n",
- " Receiver \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " P1 \n",
- " 1 \n",
- " 3.6 \n",
- " 9.7 \n",
- " PASS \n",
- " Henkie \n",
- " 1 \n",
- " Klaas Nøme \n",
- " \n",
- " \n",
- " 1 \n",
- " P2 \n",
- " 1 \n",
- " 68.3 \n",
- " 74.5 \n",
- " PASS \n",
- " Henkie \n",
- " 3 \n",
- " Piet \n",
- " \n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " code_id period_id timestamp end_timestamp code Team Packing.Value \n",
- "0 P1 1 3.6 9.7 PASS Henkie 1 \\\n",
- "1 P2 1 68.3 74.5 PASS Henkie 3 \n",
- "\n",
- " Receiver \n",
- "0 Klaas Nøme \n",
- "1 Piet "
- ]
- },
- "execution_count": 4,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "passes = code_dataset.filter(lambda code: code.code == 'PASS')\n",
- "passes.to_df()"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Writing XML file"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 5,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "\n",
- "\n",
- " \n",
- " \n",
- " P1 \n",
- " 3.6 \n",
- " 9.7 \n",
- " PASS
\n",
- " \n",
- " Team \n",
- " Henkie \n",
- " \n",
- " \n",
- " Packing.Value \n",
- " 1 \n",
- " \n",
- " \n",
- " Receiver \n",
- " Klaas Nøme \n",
- " \n",
- " \n",
- " \n",
- " P2 \n",
- " 68.3 \n",
- " 74.5 \n",
- " PASS
\n",
- " \n",
- " Team \n",
- " Henkie \n",
- " \n",
- " \n",
- " Packing.Value \n",
- " 3 \n",
- " \n",
- " \n",
- " Receiver \n",
- " Piet \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "\n"
- ]
- }
- ],
- "source": [
- "sportscode.save(passes, \"file.xml\")\n",
- "\n",
- "with open(\"file.xml\", \"r\") as fp:\n",
- " print(fp.read())"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Converting event dataset into XML dataset"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 6,
- "metadata": {},
- "outputs": [
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "/Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages/kloppy-3.10.2-py3.10.egg/kloppy/_providers/statsbomb.py:67: UserWarning: \n",
- "\n",
- "You are about to use StatsBomb public data.\n",
- "By using this data, you are agreeing to the user agreement. \n",
- "The user agreement can be found here: https://github.com/statsbomb/open-data/blob/master/LICENSE.pdf\n",
- "\n",
- " warnings.warn(\n"
- ]
- }
- ],
- "source": [
- "from kloppy import statsbomb\n",
- "\n",
- "dataset = statsbomb.load_open_data()"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 7,
- "metadata": {},
- "outputs": [],
- "source": [
- "from kloppy.domain import Code, CodeDataset, EventType\n",
- "\n",
- "dataset_shots = dataset.filter(\n",
- " lambda event: event.event_type == EventType.SHOT\n",
- ")\n",
- "\n",
- "code_dataset = (\n",
- " CodeDataset\n",
- " .from_dataset(\n",
- " dataset_shots,\n",
- " lambda event: Code(\n",
- " code_id=None, # make it auto increment on write\n",
- " code=event.event_name,\n",
- " period=event.period,\n",
- " timestamp=max(0, event.timestamp - 7),\n",
- " end_timestamp=event.timestamp + 5,\n",
- " labels={\n",
- " 'Player': str(event.player),\n",
- " 'Team': str(event.team)\n",
- " },\n",
- " \n",
- " # In the future next two won't be needed anymore\n",
- " ball_owning_team=None,\n",
- " ball_state=None\n",
- " )\n",
- " )\n",
- ")"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 8,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " code_id \n",
- " period_id \n",
- " timestamp \n",
- " end_timestamp \n",
- " code \n",
- " Player \n",
- " Team \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " None \n",
- " 1 \n",
- " 142.094 \n",
- " 154.094 \n",
- " shot \n",
- " Lionel Andrés Messi Cuccittini \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 1 \n",
- " None \n",
- " 1 \n",
- " 332.239 \n",
- " 344.239 \n",
- " shot \n",
- " Jordi Alba Ramos \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 2 \n",
- " None \n",
- " 1 \n",
- " 921.625 \n",
- " 933.625 \n",
- " shot \n",
- " Lionel Andrés Messi Cuccittini \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 3 \n",
- " None \n",
- " 1 \n",
- " 972.616 \n",
- " 984.616 \n",
- " shot \n",
- " Rubén Sobrino Pozuelo \n",
- " Deportivo Alavés \n",
- " \n",
- " \n",
- " 4 \n",
- " None \n",
- " 1 \n",
- " 1088.914 \n",
- " 1100.914 \n",
- " shot \n",
- " Luis Alberto Suárez Díaz \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 5 \n",
- " None \n",
- " 1 \n",
- " 1835.287 \n",
- " 1847.287 \n",
- " shot \n",
- " Ousmane Dembélé \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 6 \n",
- " None \n",
- " 1 \n",
- " 2097.861 \n",
- " 2109.861 \n",
- " shot \n",
- " Ivan Rakitić \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 7 \n",
- " None \n",
- " 1 \n",
- " 2241.168 \n",
- " 2253.168 \n",
- " shot \n",
- " Lionel Andrés Messi Cuccittini \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 8 \n",
- " None \n",
- " 1 \n",
- " 2243.989 \n",
- " 2255.989 \n",
- " shot \n",
- " Gerard Piqué Bernabéu \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 9 \n",
- " None \n",
- " 1 \n",
- " 2301.083 \n",
- " 2313.083 \n",
- " shot \n",
- " Ousmane Dembélé \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 10 \n",
- " None \n",
- " 1 \n",
- " 2427.592 \n",
- " 2439.592 \n",
- " shot \n",
- " Luis Alberto Suárez Díaz \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 11 \n",
- " None \n",
- " 1 \n",
- " 2603.612 \n",
- " 2615.612 \n",
- " shot \n",
- " Ousmane Dembélé \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 12 \n",
- " None \n",
- " 2 \n",
- " 152.524 \n",
- " 164.524 \n",
- " shot \n",
- " Jordi Alba Ramos \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 13 \n",
- " None \n",
- " 2 \n",
- " 360.400 \n",
- " 372.400 \n",
- " shot \n",
- " Mubarak Wakaso \n",
- " Deportivo Alavés \n",
- " \n",
- " \n",
- " 14 \n",
- " None \n",
- " 2 \n",
- " 527.355 \n",
- " 539.355 \n",
- " shot \n",
- " Luis Alberto Suárez Díaz \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 15 \n",
- " None \n",
- " 2 \n",
- " 589.388 \n",
- " 601.388 \n",
- " shot \n",
- " Philippe Coutinho Correia \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 16 \n",
- " None \n",
- " 2 \n",
- " 627.490 \n",
- " 639.490 \n",
- " shot \n",
- " Jordi Alba Ramos \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 17 \n",
- " None \n",
- " 2 \n",
- " 733.847 \n",
- " 745.847 \n",
- " shot \n",
- " Lionel Andrés Messi Cuccittini \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 18 \n",
- " None \n",
- " 2 \n",
- " 929.156 \n",
- " 941.156 \n",
- " shot \n",
- " Philippe Coutinho Correia \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 19 \n",
- " None \n",
- " 2 \n",
- " 1084.954 \n",
- " 1096.954 \n",
- " shot \n",
- " Lionel Andrés Messi Cuccittini \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 20 \n",
- " None \n",
- " 2 \n",
- " 1236.588 \n",
- " 1248.588 \n",
- " shot \n",
- " Lionel Andrés Messi Cuccittini \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 21 \n",
- " None \n",
- " 2 \n",
- " 1406.375 \n",
- " 1418.375 \n",
- " shot \n",
- " Ivan Rakitić \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 22 \n",
- " None \n",
- " 2 \n",
- " 1640.492 \n",
- " 1652.492 \n",
- " shot \n",
- " Luis Alberto Suárez Díaz \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 23 \n",
- " None \n",
- " 2 \n",
- " 1990.679 \n",
- " 2002.679 \n",
- " shot \n",
- " Adrián Marín Gómez \n",
- " Deportivo Alavés \n",
- " \n",
- " \n",
- " 24 \n",
- " None \n",
- " 2 \n",
- " 2184.606 \n",
- " 2196.606 \n",
- " shot \n",
- " Philippe Coutinho Correia \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 25 \n",
- " None \n",
- " 2 \n",
- " 2254.578 \n",
- " 2266.578 \n",
- " shot \n",
- " Philippe Coutinho Correia \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 26 \n",
- " None \n",
- " 2 \n",
- " 2655.638 \n",
- " 2667.638 \n",
- " shot \n",
- " Lionel Andrés Messi Cuccittini \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 27 \n",
- " None \n",
- " 2 \n",
- " 2795.770 \n",
- " 2807.770 \n",
- " shot \n",
- " Lionel Andrés Messi Cuccittini \n",
- " Barcelona \n",
- " \n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " code_id period_id timestamp end_timestamp code \n",
- "0 None 1 142.094 154.094 shot \\\n",
- "1 None 1 332.239 344.239 shot \n",
- "2 None 1 921.625 933.625 shot \n",
- "3 None 1 972.616 984.616 shot \n",
- "4 None 1 1088.914 1100.914 shot \n",
- "5 None 1 1835.287 1847.287 shot \n",
- "6 None 1 2097.861 2109.861 shot \n",
- "7 None 1 2241.168 2253.168 shot \n",
- "8 None 1 2243.989 2255.989 shot \n",
- "9 None 1 2301.083 2313.083 shot \n",
- "10 None 1 2427.592 2439.592 shot \n",
- "11 None 1 2603.612 2615.612 shot \n",
- "12 None 2 152.524 164.524 shot \n",
- "13 None 2 360.400 372.400 shot \n",
- "14 None 2 527.355 539.355 shot \n",
- "15 None 2 589.388 601.388 shot \n",
- "16 None 2 627.490 639.490 shot \n",
- "17 None 2 733.847 745.847 shot \n",
- "18 None 2 929.156 941.156 shot \n",
- "19 None 2 1084.954 1096.954 shot \n",
- "20 None 2 1236.588 1248.588 shot \n",
- "21 None 2 1406.375 1418.375 shot \n",
- "22 None 2 1640.492 1652.492 shot \n",
- "23 None 2 1990.679 2002.679 shot \n",
- "24 None 2 2184.606 2196.606 shot \n",
- "25 None 2 2254.578 2266.578 shot \n",
- "26 None 2 2655.638 2667.638 shot \n",
- "27 None 2 2795.770 2807.770 shot \n",
- "\n",
- " Player Team \n",
- "0 Lionel Andrés Messi Cuccittini Barcelona \n",
- "1 Jordi Alba Ramos Barcelona \n",
- "2 Lionel Andrés Messi Cuccittini Barcelona \n",
- "3 Rubén Sobrino Pozuelo Deportivo Alavés \n",
- "4 Luis Alberto Suárez Díaz Barcelona \n",
- "5 Ousmane Dembélé Barcelona \n",
- "6 Ivan Rakitić Barcelona \n",
- "7 Lionel Andrés Messi Cuccittini Barcelona \n",
- "8 Gerard Piqué Bernabéu Barcelona \n",
- "9 Ousmane Dembélé Barcelona \n",
- "10 Luis Alberto Suárez Díaz Barcelona \n",
- "11 Ousmane Dembélé Barcelona \n",
- "12 Jordi Alba Ramos Barcelona \n",
- "13 Mubarak Wakaso Deportivo Alavés \n",
- "14 Luis Alberto Suárez Díaz Barcelona \n",
- "15 Philippe Coutinho Correia Barcelona \n",
- "16 Jordi Alba Ramos Barcelona \n",
- "17 Lionel Andrés Messi Cuccittini Barcelona \n",
- "18 Philippe Coutinho Correia Barcelona \n",
- "19 Lionel Andrés Messi Cuccittini Barcelona \n",
- "20 Lionel Andrés Messi Cuccittini Barcelona \n",
- "21 Ivan Rakitić Barcelona \n",
- "22 Luis Alberto Suárez Díaz Barcelona \n",
- "23 Adrián Marín Gómez Deportivo Alavés \n",
- "24 Philippe Coutinho Correia Barcelona \n",
- "25 Philippe Coutinho Correia Barcelona \n",
- "26 Lionel Andrés Messi Cuccittini Barcelona \n",
- "27 Lionel Andrés Messi Cuccittini Barcelona "
- ]
- },
- "execution_count": 8,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "code_dataset.to_df()"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 9,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "\n",
- "\n",
- " \n",
- " \n",
- " 1 \n",
- " 142.094 \n",
- " 154.094 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Lionel Andrés Messi Cuccittini \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 2 \n",
- " 332.239 \n",
- " 344.239 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Jordi Alba Ramos \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 3 \n",
- " 921.625 \n",
- " 933.625 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Lionel Andrés Messi Cuccittini \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 4 \n",
- " 972.616 \n",
- " 984.616 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Rubén Sobrino Pozuelo \n",
- " \n",
- " \n",
- " Team \n",
- " Deportivo Alavés \n",
- " \n",
- " \n",
- " \n",
- " 5 \n",
- " 1088.914 \n",
- " 1100.914 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Luis Alberto Suárez Díaz \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 6 \n",
- " 1835.287 \n",
- " 1847.287 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Ousmane Dembélé \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 7 \n",
- " 2097.861 \n",
- " 2109.861 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Ivan Rakitić \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 8 \n",
- " 2241.168 \n",
- " 2253.168 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Lionel Andrés Messi Cuccittini \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 9 \n",
- " 2243.989 \n",
- " 2255.989 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Gerard Piqué Bernabéu \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 10 \n",
- " 2301.083 \n",
- " 2313.083 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Ousmane Dembélé \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 11 \n",
- " 2427.592 \n",
- " 2439.592 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Luis Alberto Suárez Díaz \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 12 \n",
- " 2603.612 \n",
- " 2615.612 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Ousmane Dembélé \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 13 \n",
- " 2857.7909999999997 \n",
- " 2869.7909999999997 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Jordi Alba Ramos \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 14 \n",
- " 3065.667 \n",
- " 3077.667 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Mubarak Wakaso \n",
- " \n",
- " \n",
- " Team \n",
- " Deportivo Alavés \n",
- " \n",
- " \n",
- " \n",
- " 15 \n",
- " 3232.622 \n",
- " 3244.622 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Luis Alberto Suárez Díaz \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 16 \n",
- " 3294.6549999999997 \n",
- " 3306.6549999999997 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Philippe Coutinho Correia \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 17 \n",
- " 3332.7569999999996 \n",
- " 3344.7569999999996 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Jordi Alba Ramos \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 18 \n",
- " 3439.1139999999996 \n",
- " 3451.1139999999996 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Lionel Andrés Messi Cuccittini \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 19 \n",
- " 3634.423 \n",
- " 3646.423 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Philippe Coutinho Correia \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 20 \n",
- " 3790.2209999999995 \n",
- " 3802.2209999999995 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Lionel Andrés Messi Cuccittini \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 21 \n",
- " 3941.8549999999996 \n",
- " 3953.8549999999996 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Lionel Andrés Messi Cuccittini \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 22 \n",
- " 4111.642 \n",
- " 4123.642 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Ivan Rakitić \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 23 \n",
- " 4345.759 \n",
- " 4357.759 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Luis Alberto Suárez Díaz \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 24 \n",
- " 4695.946 \n",
- " 4707.946 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Adrián Marín Gómez \n",
- " \n",
- " \n",
- " Team \n",
- " Deportivo Alavés \n",
- " \n",
- " \n",
- " \n",
- " 25 \n",
- " 4889.873 \n",
- " 4901.873 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Philippe Coutinho Correia \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 26 \n",
- " 4959.844999999999 \n",
- " 4971.844999999999 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Philippe Coutinho Correia \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 27 \n",
- " 5360.905 \n",
- " 5372.905 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Lionel Andrés Messi Cuccittini \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " 28 \n",
- " 5501.037 \n",
- " 5513.037 \n",
- " shot
\n",
- " \n",
- " Player \n",
- " Lionel Andrés Messi Cuccittini \n",
- " \n",
- " \n",
- " Team \n",
- " Barcelona \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "\n"
- ]
- }
- ],
- "source": [
- "sportscode.save(code_dataset, \"file.xml\")\n",
- "\n",
- "with open(\"file.xml\", \"r\") as fp:\n",
- " print(fp.read())"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 10,
- "metadata": {},
- "outputs": [],
- "source": [
- "import os\n",
- "os.unlink(\"file.xml\")"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 14,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " code_id \n",
- " period_id \n",
- " timestamp \n",
- " end_timestamp \n",
- " code \n",
- " Player \n",
- " Team \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " None \n",
- " 1 \n",
- " 142.094 \n",
- " 154.094 \n",
- " Schot Barcelona \n",
- " Lionel Andrés Messi Cuccittini \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 1 \n",
- " None \n",
- " 1 \n",
- " 332.239 \n",
- " 344.239 \n",
- " Schot Barcelona \n",
- " Jordi Alba Ramos \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 2 \n",
- " None \n",
- " 1 \n",
- " 921.625 \n",
- " 933.625 \n",
- " Schot Barcelona \n",
- " Lionel Andrés Messi Cuccittini \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 3 \n",
- " None \n",
- " 1 \n",
- " 1088.914 \n",
- " 1100.914 \n",
- " Schot Barcelona \n",
- " Luis Alberto Suárez Díaz \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 4 \n",
- " None \n",
- " 1 \n",
- " 1835.287 \n",
- " 1847.287 \n",
- " Schot Barcelona \n",
- " Ousmane Dembélé \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 5 \n",
- " None \n",
- " 1 \n",
- " 2097.861 \n",
- " 2109.861 \n",
- " Schot Barcelona \n",
- " Ivan Rakitić \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 6 \n",
- " None \n",
- " 1 \n",
- " 2241.168 \n",
- " 2253.168 \n",
- " Schot Barcelona \n",
- " Lionel Andrés Messi Cuccittini \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 7 \n",
- " None \n",
- " 1 \n",
- " 2243.989 \n",
- " 2255.989 \n",
- " Schot Barcelona \n",
- " Gerard Piqué Bernabéu \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 8 \n",
- " None \n",
- " 1 \n",
- " 2301.083 \n",
- " 2313.083 \n",
- " Schot Barcelona \n",
- " Ousmane Dembélé \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 9 \n",
- " None \n",
- " 1 \n",
- " 2427.592 \n",
- " 2439.592 \n",
- " Schot Barcelona \n",
- " Luis Alberto Suárez Díaz \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 10 \n",
- " None \n",
- " 1 \n",
- " 2603.612 \n",
- " 2615.612 \n",
- " Schot Barcelona \n",
- " Ousmane Dembélé \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 11 \n",
- " None \n",
- " 2 \n",
- " 152.524 \n",
- " 164.524 \n",
- " Schot Barcelona \n",
- " Jordi Alba Ramos \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 12 \n",
- " None \n",
- " 2 \n",
- " 527.355 \n",
- " 539.355 \n",
- " Schot Barcelona \n",
- " Luis Alberto Suárez Díaz \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 13 \n",
- " None \n",
- " 2 \n",
- " 589.388 \n",
- " 601.388 \n",
- " Schot Barcelona \n",
- " Philippe Coutinho Correia \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 14 \n",
- " None \n",
- " 2 \n",
- " 627.490 \n",
- " 639.490 \n",
- " Schot Barcelona \n",
- " Jordi Alba Ramos \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 15 \n",
- " None \n",
- " 2 \n",
- " 733.847 \n",
- " 745.847 \n",
- " Schot Barcelona \n",
- " Lionel Andrés Messi Cuccittini \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 16 \n",
- " None \n",
- " 2 \n",
- " 929.156 \n",
- " 941.156 \n",
- " Schot Barcelona \n",
- " Philippe Coutinho Correia \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 17 \n",
- " None \n",
- " 2 \n",
- " 1084.954 \n",
- " 1096.954 \n",
- " Schot Barcelona \n",
- " Lionel Andrés Messi Cuccittini \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 18 \n",
- " None \n",
- " 2 \n",
- " 1236.588 \n",
- " 1248.588 \n",
- " Schot Barcelona \n",
- " Lionel Andrés Messi Cuccittini \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 19 \n",
- " None \n",
- " 2 \n",
- " 1406.375 \n",
- " 1418.375 \n",
- " Schot Barcelona \n",
- " Ivan Rakitić \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 20 \n",
- " None \n",
- " 2 \n",
- " 1640.492 \n",
- " 1652.492 \n",
- " Schot Barcelona \n",
- " Luis Alberto Suárez Díaz \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 21 \n",
- " None \n",
- " 2 \n",
- " 2184.606 \n",
- " 2196.606 \n",
- " Schot Barcelona \n",
- " Philippe Coutinho Correia \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 22 \n",
- " None \n",
- " 2 \n",
- " 2254.578 \n",
- " 2266.578 \n",
- " Schot Barcelona \n",
- " Philippe Coutinho Correia \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 23 \n",
- " None \n",
- " 2 \n",
- " 2655.638 \n",
- " 2667.638 \n",
- " Schot Barcelona \n",
- " Lionel Andrés Messi Cuccittini \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 24 \n",
- " None \n",
- " 2 \n",
- " 2795.770 \n",
- " 2807.770 \n",
- " Schot Barcelona \n",
- " Lionel Andrés Messi Cuccittini \n",
- " Barcelona \n",
- " \n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " code_id period_id timestamp end_timestamp code \n",
- "0 None 1 142.094 154.094 Schot Barcelona \\\n",
- "1 None 1 332.239 344.239 Schot Barcelona \n",
- "2 None 1 921.625 933.625 Schot Barcelona \n",
- "3 None 1 1088.914 1100.914 Schot Barcelona \n",
- "4 None 1 1835.287 1847.287 Schot Barcelona \n",
- "5 None 1 2097.861 2109.861 Schot Barcelona \n",
- "6 None 1 2241.168 2253.168 Schot Barcelona \n",
- "7 None 1 2243.989 2255.989 Schot Barcelona \n",
- "8 None 1 2301.083 2313.083 Schot Barcelona \n",
- "9 None 1 2427.592 2439.592 Schot Barcelona \n",
- "10 None 1 2603.612 2615.612 Schot Barcelona \n",
- "11 None 2 152.524 164.524 Schot Barcelona \n",
- "12 None 2 527.355 539.355 Schot Barcelona \n",
- "13 None 2 589.388 601.388 Schot Barcelona \n",
- "14 None 2 627.490 639.490 Schot Barcelona \n",
- "15 None 2 733.847 745.847 Schot Barcelona \n",
- "16 None 2 929.156 941.156 Schot Barcelona \n",
- "17 None 2 1084.954 1096.954 Schot Barcelona \n",
- "18 None 2 1236.588 1248.588 Schot Barcelona \n",
- "19 None 2 1406.375 1418.375 Schot Barcelona \n",
- "20 None 2 1640.492 1652.492 Schot Barcelona \n",
- "21 None 2 2184.606 2196.606 Schot Barcelona \n",
- "22 None 2 2254.578 2266.578 Schot Barcelona \n",
- "23 None 2 2655.638 2667.638 Schot Barcelona \n",
- "24 None 2 2795.770 2807.770 Schot Barcelona \n",
- "\n",
- " Player Team \n",
- "0 Lionel Andrés Messi Cuccittini Barcelona \n",
- "1 Jordi Alba Ramos Barcelona \n",
- "2 Lionel Andrés Messi Cuccittini Barcelona \n",
- "3 Luis Alberto Suárez Díaz Barcelona \n",
- "4 Ousmane Dembélé Barcelona \n",
- "5 Ivan Rakitić Barcelona \n",
- "6 Lionel Andrés Messi Cuccittini Barcelona \n",
- "7 Gerard Piqué Bernabéu Barcelona \n",
- "8 Ousmane Dembélé Barcelona \n",
- "9 Luis Alberto Suárez Díaz Barcelona \n",
- "10 Ousmane Dembélé Barcelona \n",
- "11 Jordi Alba Ramos Barcelona \n",
- "12 Luis Alberto Suárez Díaz Barcelona \n",
- "13 Philippe Coutinho Correia Barcelona \n",
- "14 Jordi Alba Ramos Barcelona \n",
- "15 Lionel Andrés Messi Cuccittini Barcelona \n",
- "16 Philippe Coutinho Correia Barcelona \n",
- "17 Lionel Andrés Messi Cuccittini Barcelona \n",
- "18 Lionel Andrés Messi Cuccittini Barcelona \n",
- "19 Ivan Rakitić Barcelona \n",
- "20 Luis Alberto Suárez Díaz Barcelona \n",
- "21 Philippe Coutinho Correia Barcelona \n",
- "22 Philippe Coutinho Correia Barcelona \n",
- "23 Lionel Andrés Messi Cuccittini Barcelona \n",
- "24 Lionel Andrés Messi Cuccittini Barcelona "
- ]
- },
- "execution_count": 14,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "# Chain filter and map operators\n",
- "new_dataset = (\n",
- " code_dataset\n",
- " .filter(lambda record: record.labels['Team'] == 'Barcelona')\n",
- " .map(lambda record: record.replace(code='Schot Barcelona'))\n",
- ")\n",
- "new_dataset.to_df()"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "kloppy-venv",
- "language": "python",
- "name": "kloppy-venv"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.10.6"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 4
-}
diff --git a/docs/examples/config.ipynb b/docs/examples/config.ipynb
deleted file mode 100644
index 6f78ed7a..00000000
--- a/docs/examples/config.ipynb
+++ /dev/null
@@ -1,211 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "id": "20bb72b7",
- "metadata": {},
- "source": [
- "# Config\n",
- "\n",
- "Kloppy 3.3 adds support for setting global configuration. This makes it possible to set the coordinate system for all `load` calls, setting the cache directory (or disabling the cache) and passing settings to adapters.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 5,
- "id": "e8979b51",
- "metadata": {},
- "outputs": [],
- "source": [
- "from kloppy.config import get_config, set_config, config_context"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "85c33f79",
- "metadata": {},
- "source": [
- "## Get config\n",
- "\n",
- "You can get all configuration variable or just a single one using `get_config`."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 6,
- "id": "b70b22c9",
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "{'cache': '/Users/koen/kloppy_cache',\n",
- " 'coordinate_system': 'kloppy',\n",
- " 'event_factory': None,\n",
- " 'adapters.http.basic_authentication': None,\n",
- " 'adapters.s3.s3fs': None,\n",
- " 'dataframe.engine': 'pandas'}"
- ]
- },
- "execution_count": 6,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "get_config()"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 7,
- "id": "9d75b69b",
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "'kloppy'"
- ]
- },
- "execution_count": 7,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "get_config(\"coordinate_system\")"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "07f1ce9b",
- "metadata": {},
- "source": [
- "## Set config\n",
- "\n",
- "Using `set_config` you can set the value for a single config variable. This value will be used for all calls to kloppy."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 8,
- "id": "1ba6227a",
- "metadata": {},
- "outputs": [
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "/Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages/kloppy-3.7.1-py3.10.egg/kloppy/_providers/statsbomb.py:67: UserWarning: \n",
- "\n",
- "You are about to use StatsBomb public data.\n",
- "By using this data, you are agreeing to the user agreement. \n",
- "The user agreement can be found here: https://github.com/statsbomb/open-data/blob/master/LICENSE.pdf\n",
- "\n",
- " warnings.warn(\n"
- ]
- },
- {
- "data": {
- "text/plain": [
- "OptaCoordinateSystem(normalized=False, length=120, width=80)"
- ]
- },
- "execution_count": 8,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "from kloppy import statsbomb\n",
- "\n",
- "set_config(\"coordinate_system\", \"opta\")\n",
- "\n",
- "dataset = statsbomb.load_open_data()\n",
- "\n",
- "dataset.metadata.coordinate_system"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "471839e3",
- "metadata": {},
- "source": [
- "## Config context\n",
- "\n",
- "Inspired by pandas kloppy allows you to set config variables for a context (using a context manager). Config set using `config_context` will be reverted to to original values when python exists the context"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 9,
- "id": "6fc5b89c",
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Before context: opta\n",
- "Within context: statsbomb\n",
- "After context: opta\n"
- ]
- },
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "/Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages/kloppy-3.7.1-py3.10.egg/kloppy/_providers/statsbomb.py:67: UserWarning: \n",
- "\n",
- "You are about to use StatsBomb public data.\n",
- "By using this data, you are agreeing to the user agreement. \n",
- "The user agreement can be found here: https://github.com/statsbomb/open-data/blob/master/LICENSE.pdf\n",
- "\n",
- " warnings.warn(\n"
- ]
- },
- {
- "data": {
- "text/plain": [
- "StatsBombCoordinateSystem(normalized=False, length=120, width=80)"
- ]
- },
- "execution_count": 9,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "print(f\"Before context: {get_config('coordinate_system')}\")\n",
- "with config_context(\"coordinate_system\", \"statsbomb\"):\n",
- " print(f\"Within context: {get_config('coordinate_system')}\")\n",
- " dataset = statsbomb.load_open_data()\n",
- " \n",
- "print(f\"After context: {get_config('coordinate_system')}\")\n",
- "dataset.metadata.coordinate_system"
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "kloppy-venv",
- "language": "python",
- "name": "kloppy-venv"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.10.6"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 5
-}
diff --git a/docs/examples/event_data.ipynb b/docs/examples/event_data.ipynb
deleted file mode 100644
index 3aeb5304..00000000
--- a/docs/examples/event_data.ipynb
+++ /dev/null
@@ -1,1903 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Event data\n",
- "\n",
- "One of the main benefits of working with kloppy is that it loads metadata with the event data. This metadata includes teams (name, ground and provider id) and players (name, jersey number, optional position and provider id). Using this metadata, it becomes very easy to create an analysis that is usable by humans, because it includes names instead of only numbers.\n",
- "\n",
- "This section shows how metadata is organized and some use-cases."
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Loading statsbomb data\n",
- "\n",
- "The datasets module of kloppy makes it trivial to load statsbomb data. Keep in mind that by using the data you accept the license of the open-data project.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 55,
- "metadata": {
- "scrolled": true
- },
- "outputs": [],
- "source": [
- "from kloppy import statsbomb\n",
- "\n",
- "dataset = statsbomb.load_open_data(event_types=[\"pass\", \"shot\"])"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Exploring metadata\n",
- "\n",
- "kloppy always loads the metadata for you and makes it available at the `metadata` property. "
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 56,
- "metadata": {},
- "outputs": [],
- "source": [
- "metadata = dataset.metadata\n",
- "home_team, away_team = metadata.teams"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "After loading the data, the metadata can be used to iterate over teams and players. By default `metadata.teams` contain `[HomeTeam, AwayTeam]`. `Team` and `Player` entities have the `__str__` magic method implemented to help you cast it to a string. When you want to "
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 57,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "home - Barcelona\n",
- "away - Deportivo Alavés\n"
- ]
- }
- ],
- "source": [
- "print(f\"{home_team.ground} - {home_team}\")\n",
- "print(f\"{away_team.ground} - {away_team}\")"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 58,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "['Malcom Filipe Silva de Oliveira (14)',\n",
- " 'Philippe Coutinho Correia (7)',\n",
- " 'Sergio Busquets i Burgos (5)',\n",
- " 'Jordi Alba Ramos (18)',\n",
- " 'Gerard Piqué Bernabéu (3)',\n",
- " 'Luis Alberto Suárez Díaz (9)',\n",
- " 'Ivan Rakitić (4)',\n",
- " 'Ousmane Dembélé (11)',\n",
- " 'Samuel Yves Umtiti (23)',\n",
- " 'Lionel Andrés Messi Cuccittini (10)',\n",
- " 'Nélson Cabral Semedo (2)',\n",
- " 'Sergi Roberto Carnicer (20)',\n",
- " 'Clément Lenglet (15)',\n",
- " 'Rafael Alcântara do Nascimento (12)',\n",
- " 'Arturo Erasmo Vidal Pardo (22)',\n",
- " 'Jasper Cillessen (13)',\n",
- " 'Arthur Henrique Ramos de Oliveira Melo (8)',\n",
- " 'Marc-André ter Stegen (1)']"
- ]
- },
- "execution_count": 58,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "[f\"{player} ({player.jersey_no})\" for player in home_team.players]\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 59,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "'statsbomb team id: 217 - 206'"
- ]
- },
- "execution_count": 59,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "# get provider id for team\n",
- "f\"statsbomb team id: {home_team.team_id} - {away_team.team_id}\""
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 60,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "['Malcom Filipe Silva de Oliveira id=3109',\n",
- " 'Philippe Coutinho Correia id=3501',\n",
- " 'Sergio Busquets i Burgos id=5203',\n",
- " 'Jordi Alba Ramos id=5211',\n",
- " 'Gerard Piqué Bernabéu id=5213',\n",
- " 'Luis Alberto Suárez Díaz id=5246',\n",
- " 'Ivan Rakitić id=5470',\n",
- " 'Ousmane Dembélé id=5477',\n",
- " 'Samuel Yves Umtiti id=5492',\n",
- " 'Lionel Andrés Messi Cuccittini id=5503',\n",
- " 'Nélson Cabral Semedo id=6374',\n",
- " 'Sergi Roberto Carnicer id=6379',\n",
- " 'Clément Lenglet id=6826',\n",
- " 'Rafael Alcântara do Nascimento id=6998',\n",
- " 'Arturo Erasmo Vidal Pardo id=8206',\n",
- " 'Jasper Cillessen id=8652',\n",
- " 'Arthur Henrique Ramos de Oliveira Melo id=11392',\n",
- " 'Marc-André ter Stegen id=20055']"
- ]
- },
- "execution_count": 60,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "# same for the players\n",
- "[f\"{player} id={player.player_id}\" for player in metadata.teams[0].players]\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 61,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Jonathan Rodríguez Menéndez\n",
- "Deportivo Alavés\n",
- "Teams are comparable? True\n"
- ]
- }
- ],
- "source": [
- "# get player from first event\n",
- "player = dataset.events[0].player\n",
- "print(player)\n",
- "print(player.team)\n",
- "print(f\"Teams are comparable? {player.team == away_team}\")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "The `Team` and `Player` entities also contain the magic methods to use those keys in dictionaries or use them in sets. This makes it easy to do some calculations, and show the results without mapping the player_id to a name."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 62,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Jonathan Rodríguez Menéndez has 14 passes\n",
- "Guillermo Alfonso Maripán Loaysa has 18 passes\n",
- "Sergio Busquets i Burgos has 79 passes\n",
- "Ivan Rakitić has 138 passes\n",
- "Ousmane Dembélé has 65 passes\n",
- "Jordi Alba Ramos has 121 passes\n",
- "Víctor Laguardia Cisneros has 11 passes\n",
- "Marc-André ter Stegen has 23 passes\n",
- "Gerard Piqué Bernabéu has 79 passes\n",
- "Nélson Cabral Semedo has 31 passes\n",
- "Sergi Roberto Carnicer has 85 passes\n",
- "Samuel Yves Umtiti has 63 passes\n",
- "Lionel Andrés Messi Cuccittini has 92 passes\n",
- "Rubén Duarte Sánchez has 25 passes\n",
- "Ibai Gómez Pérez has 35 passes\n",
- "Mubarak Wakaso has 23 passes\n",
- "Manuel Alejandro García Sánchez has 23 passes\n",
- "Rubén Sobrino Pozuelo has 17 passes\n",
- "Luis Alberto Suárez Díaz has 38 passes\n",
- "Fernando Pacheco Flores has 16 passes\n",
- "Martín Aguirregabiria Padilla has 20 passes\n",
- "Daniel Alejandro Torres Rojas has 16 passes\n",
- "Philippe Coutinho Correia has 51 passes\n",
- "Jorge Franco Alviz has 11 passes\n",
- "Adrián Marín Gómez has 6 passes\n",
- "Arthur Henrique Ramos de Oliveira Melo has 18 passes\n",
- "Borja González Tomás has 7 passes\n",
- "Arturo Erasmo Vidal Pardo has 7 passes\n"
- ]
- }
- ],
- "source": [
- "from collections import defaultdict\n",
- "\n",
- "passes_per_player = defaultdict(list)\n",
- "for event in dataset.events:\n",
- " if event.event_name == \"pass\":\n",
- " passes_per_player[event.player].append(event)\n",
- " \n",
- "for player, passes in passes_per_player.items():\n",
- " print(f\"{player} has {len(passes)} passes\")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Now let's filter on home_team."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 63,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Sergio Busquets i Burgos has 79 passes\n",
- "Ivan Rakitić has 138 passes\n",
- "Ousmane Dembélé has 65 passes\n",
- "Jordi Alba Ramos has 121 passes\n",
- "Marc-André ter Stegen has 23 passes\n",
- "Gerard Piqué Bernabéu has 79 passes\n",
- "Nélson Cabral Semedo has 31 passes\n",
- "Sergi Roberto Carnicer has 85 passes\n",
- "Samuel Yves Umtiti has 63 passes\n",
- "Lionel Andrés Messi Cuccittini has 92 passes\n",
- "Luis Alberto Suárez Díaz has 38 passes\n",
- "Philippe Coutinho Correia has 51 passes\n",
- "Arthur Henrique Ramos de Oliveira Melo has 18 passes\n",
- "Arturo Erasmo Vidal Pardo has 7 passes\n"
- ]
- }
- ],
- "source": [
- "for player, passes in passes_per_player.items():\n",
- " if player.team == home_team:\n",
- " print(f\"{player} has {len(passes)} passes\")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Use metadata when transforming to pandas dataframe\n",
- "\n",
- "The metadata can also be used when transforming a dataset to a pandas dataframe. Using keyword argument additional columns can be created."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 64,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " event_id \n",
- " event_type \n",
- " result \n",
- " timestamp \n",
- " player_id \n",
- " player_name \n",
- " team_name \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " 34208ade-2af4-45c3-970e-655937cad938 \n",
- " PASS \n",
- " COMPLETE \n",
- " 0.098 \n",
- " 6581 \n",
- " Jonathan Rodríguez Menéndez \n",
- " Deportivo Alavés \n",
- " \n",
- " \n",
- " 1 \n",
- " d1cccb73-c7ef-4b02-8267-ebd7f149904b \n",
- " PASS \n",
- " INCOMPLETE \n",
- " 3.497 \n",
- " 6855 \n",
- " Guillermo Alfonso Maripán Loaysa \n",
- " Deportivo Alavés \n",
- " \n",
- " \n",
- " 2 \n",
- " f1cc47d6-4b19-45a6-beb9-33d67fc83f4b \n",
- " PASS \n",
- " COMPLETE \n",
- " 6.785 \n",
- " 5203 \n",
- " Sergio Busquets i Burgos \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 3 \n",
- " f774571f-4b65-43a0-9bfc-6384948d1b82 \n",
- " PASS \n",
- " COMPLETE \n",
- " 8.431 \n",
- " 5470 \n",
- " Ivan Rakitić \n",
- " Barcelona \n",
- " \n",
- " \n",
- " 4 \n",
- " 46f0e871-3e72-4817-9a53-af27583ba6c1 \n",
- " PASS \n",
- " COMPLETE \n",
- " 10.433 \n",
- " 5477 \n",
- " Ousmane Dembélé \n",
- " Barcelona \n",
- " \n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " event_id event_type result timestamp \\\n",
- "0 34208ade-2af4-45c3-970e-655937cad938 PASS COMPLETE 0.098 \n",
- "1 d1cccb73-c7ef-4b02-8267-ebd7f149904b PASS INCOMPLETE 3.497 \n",
- "2 f1cc47d6-4b19-45a6-beb9-33d67fc83f4b PASS COMPLETE 6.785 \n",
- "3 f774571f-4b65-43a0-9bfc-6384948d1b82 PASS COMPLETE 8.431 \n",
- "4 46f0e871-3e72-4817-9a53-af27583ba6c1 PASS COMPLETE 10.433 \n",
- "\n",
- " player_id player_name team_name \n",
- "0 6581 Jonathan Rodríguez Menéndez Deportivo Alavés \n",
- "1 6855 Guillermo Alfonso Maripán Loaysa Deportivo Alavés \n",
- "2 5203 Sergio Busquets i Burgos Barcelona \n",
- "3 5470 Ivan Rakitić Barcelona \n",
- "4 5477 Ousmane Dembélé Barcelona "
- ]
- },
- "execution_count": 64,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "\n",
- "dataframe = dataset.to_df(\n",
- " \"*\", # Get all default columns\n",
- " player_name=lambda event: str(event.player),\n",
- " team_name=lambda event: str(event.player.team)\n",
- ")\n",
- "\n",
- "dataframe[[\n",
- " 'event_id', 'event_type', 'result', 'timestamp', 'player_id', \n",
- " 'player_name', 'team_name'\n",
- "]].head()"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Attribute transformers\n",
- "\n",
- "Attribute transformer make it possible to add predefined attributes to a dataset. The attributes are calculated during export to a pandas DataFrame. Kloppy does provide some Transformers like one to calculate the angle to the goal, and one to calculate the distance to the goal. When you need additional Transformers you can write your one by providing a `Callable` to `to_df`. "
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 65,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " angle_to_goal \n",
- " distance_to_goal \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " 90.481466 \n",
- " 59.502101 \n",
- " \n",
- " \n",
- " 1 \n",
- " 82.249964 \n",
- " 85.278954 \n",
- " \n",
- " \n",
- " 2 \n",
- " 69.187354 \n",
- " 91.468574 \n",
- " \n",
- " \n",
- " 3 \n",
- " 77.005383 \n",
- " 86.720816 \n",
- " \n",
- " \n",
- " 4 \n",
- " 66.562013 \n",
- " 94.278842 \n",
- " \n",
- " \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " \n",
- " \n",
- " 1155 \n",
- " 121.578165 \n",
- " 63.972650 \n",
- " \n",
- " \n",
- " 1156 \n",
- " 104.393593 \n",
- " 58.330952 \n",
- " \n",
- " \n",
- " 1157 \n",
- " 39.559668 \n",
- " 44.749302 \n",
- " \n",
- " \n",
- " 1158 \n",
- " 71.095424 \n",
- " 38.581083 \n",
- " \n",
- " \n",
- " 1159 \n",
- " 55.901268 \n",
- " 9.721368 \n",
- " \n",
- " \n",
- "
\n",
- "
1160 rows × 2 columns
\n",
- "
"
- ],
- "text/plain": [
- " angle_to_goal distance_to_goal\n",
- "0 90.481466 59.502101\n",
- "1 82.249964 85.278954\n",
- "2 69.187354 91.468574\n",
- "3 77.005383 86.720816\n",
- "4 66.562013 94.278842\n",
- "... ... ...\n",
- "1155 121.578165 63.972650\n",
- "1156 104.393593 58.330952\n",
- "1157 39.559668 44.749302\n",
- "1158 71.095424 38.581083\n",
- "1159 55.901268 9.721368\n",
- "\n",
- "[1160 rows x 2 columns]"
- ]
- },
- "execution_count": 65,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "from kloppy import statsbomb\n",
- "\n",
- "from kloppy.domain.services.transformers.attribute import (\n",
- " BodyPartTransformer, AngleToGoalTransformer, DistanceToGoalTransformer\n",
- ")\n",
- "\n",
- "dataset = statsbomb.load_open_data(\n",
- " event_types=[\"pass\", \"shot\"], \n",
- " coordinates=\"statsbomb\"\n",
- ")\n",
- "\n",
- "dataset.to_df(\n",
- " AngleToGoalTransformer(),\n",
- " DistanceToGoalTransformer()\n",
- ")"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 66,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "{'is_body_part_right_foot': False, 'is_body_part_left_foot': True, 'is_body_part_head': False, 'is_body_part_both_hands': False, 'is_body_part_chest': False, 'is_body_part_left_hand': False, 'is_body_part_right_hand': False, 'is_body_part_drop_kick': False, 'is_body_part_keeper_arm': False, 'is_body_part_other': False, 'is_body_part_no_touch': False}\n"
- ]
- },
- {
- "data": {
- "text/plain": [
- "{'angle_to_goal': 90.48146580583835}"
- ]
- },
- "execution_count": 66,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "event = dataset.events[0]\n",
- "\n",
- "transformer = BodyPartTransformer(encoding=\"one-hot\")\n",
- "print(transformer(event))\n",
- "\n",
- "\n",
- "transformer = AngleToGoalTransformer()\n",
- "transformer(event)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Wildcard\n",
- "\n",
- "When you want to export a set of attributes you can specify a wildcard pattern. This pattern is matched against all default (exported by the `Default` Transformer) attributes."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 67,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " period_id \n",
- " timestamp \n",
- " coordinates_x \n",
- " coordinates_y \n",
- " end_coordinates_x \n",
- " end_coordinates_y \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " 1 \n",
- " 0.098 \n",
- " 60.50 \n",
- " 40.50 \n",
- " 35.5 \n",
- " 25.5 \n",
- " \n",
- " \n",
- " 1 \n",
- " 1 \n",
- " 3.497 \n",
- " 35.50 \n",
- " 28.50 \n",
- " 85.5 \n",
- " 72.5 \n",
- " \n",
- " \n",
- " 2 \n",
- " 1 \n",
- " 6.785 \n",
- " 34.50 \n",
- " 7.50 \n",
- " 34.5 \n",
- " 20.5 \n",
- " \n",
- " \n",
- " 3 \n",
- " 1 \n",
- " 8.431 \n",
- " 35.50 \n",
- " 20.50 \n",
- " 35.5 \n",
- " 1.5 \n",
- " \n",
- " \n",
- " 4 \n",
- " 1 \n",
- " 10.433 \n",
- " 33.50 \n",
- " 2.50 \n",
- " 25.5 \n",
- " 1.5 \n",
- " \n",
- " \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " \n",
- " \n",
- " 1155 \n",
- " 2 \n",
- " 2787.914 \n",
- " 65.50 \n",
- " 73.50 \n",
- " 59.5 \n",
- " 60.5 \n",
- " \n",
- " \n",
- " 1156 \n",
- " 2 \n",
- " 2791.395 \n",
- " 63.50 \n",
- " 54.50 \n",
- " 89.5 \n",
- " 5.5 \n",
- " \n",
- " \n",
- " 1157 \n",
- " 2 \n",
- " 2795.127 \n",
- " 91.50 \n",
- " 5.50 \n",
- " 90.5 \n",
- " 26.5 \n",
- " \n",
- " \n",
- " 1158 \n",
- " 2 \n",
- " 2798.906 \n",
- " 83.50 \n",
- " 27.50 \n",
- " 106.5 \n",
- " 44.5 \n",
- " \n",
- " \n",
- " 1159 \n",
- " 2 \n",
- " 2802.770 \n",
- " 111.95 \n",
- " 34.55 \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- "
\n",
- "
1160 rows × 6 columns
\n",
- "
"
- ],
- "text/plain": [
- " period_id timestamp coordinates_x coordinates_y end_coordinates_x \\\n",
- "0 1 0.098 60.50 40.50 35.5 \n",
- "1 1 3.497 35.50 28.50 85.5 \n",
- "2 1 6.785 34.50 7.50 34.5 \n",
- "3 1 8.431 35.50 20.50 35.5 \n",
- "4 1 10.433 33.50 2.50 25.5 \n",
- "... ... ... ... ... ... \n",
- "1155 2 2787.914 65.50 73.50 59.5 \n",
- "1156 2 2791.395 63.50 54.50 89.5 \n",
- "1157 2 2795.127 91.50 5.50 90.5 \n",
- "1158 2 2798.906 83.50 27.50 106.5 \n",
- "1159 2 2802.770 111.95 34.55 NaN \n",
- "\n",
- " end_coordinates_y \n",
- "0 25.5 \n",
- "1 72.5 \n",
- "2 20.5 \n",
- "3 1.5 \n",
- "4 1.5 \n",
- "... ... \n",
- "1155 60.5 \n",
- "1156 5.5 \n",
- "1157 26.5 \n",
- "1158 44.5 \n",
- "1159 NaN \n",
- "\n",
- "[1160 rows x 6 columns]"
- ]
- },
- "execution_count": 67,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "dataset.to_df(\n",
- " 'period_id',\n",
- " 'timestamp',\n",
- " '*coordinates*',\n",
- ")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## User-defined Transformers\n",
- "\n",
- "Transformers are nothing more than a function which accepts a `Event` and returns `Dict` (`Callable[[Event], Dict])`). The Transformers provided by kloppy are actually classes that define a `__call__` method. You can also use a `lambda` function or any other function to transform attributes.\n",
- "\n",
- "When you use named attributes (specified using a keyword argument) the returned value can be any type (`Callable[[Event], Any]`). "
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 68,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " period \n",
- " timestamp \n",
- " some_columns \n",
- " other_column \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " 1 \n",
- " 0.098 \n",
- " 1234 \n",
- " 62 \n",
- " \n",
- " \n",
- " 1 \n",
- " 1 \n",
- " 3.497 \n",
- " 1234 \n",
- " 252 \n",
- " \n",
- " \n",
- " 2 \n",
- " 1 \n",
- " 6.785 \n",
- " 1234 \n",
- " 194 \n",
- " \n",
- " \n",
- " 3 \n",
- " 1 \n",
- " 8.431 \n",
- " 1234 \n",
- " 121 \n",
- " \n",
- " \n",
- " 4 \n",
- " 1 \n",
- " 10.433 \n",
- " 1234 \n",
- " 161 \n",
- " \n",
- " \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " \n",
- " \n",
- " 1155 \n",
- " 2 \n",
- " 2787.914 \n",
- " 1234 \n",
- " 230 \n",
- " \n",
- " \n",
- " 1156 \n",
- " 2 \n",
- " 2791.395 \n",
- " 1234 \n",
- " 153 \n",
- " \n",
- " \n",
- " 1157 \n",
- " 2 \n",
- " 2795.127 \n",
- " 1234 \n",
- " 151 \n",
- " \n",
- " \n",
- " 1158 \n",
- " 2 \n",
- " 2798.906 \n",
- " 1234 \n",
- " 160 \n",
- " \n",
- " \n",
- " 1159 \n",
- " 2 \n",
- " 2802.770 \n",
- " 1234 \n",
- " 242 \n",
- " \n",
- " \n",
- "
\n",
- "
1160 rows × 4 columns
\n",
- "
"
- ],
- "text/plain": [
- " period timestamp some_columns other_column\n",
- "0 1 0.098 1234 62\n",
- "1 1 3.497 1234 252\n",
- "2 1 6.785 1234 194\n",
- "3 1 8.431 1234 121\n",
- "4 1 10.433 1234 161\n",
- "... ... ... ... ...\n",
- "1155 2 2787.914 1234 230\n",
- "1156 2 2791.395 1234 153\n",
- "1157 2 2795.127 1234 151\n",
- "1158 2 2798.906 1234 160\n",
- "1159 2 2802.770 1234 242\n",
- "\n",
- "[1160 rows x 4 columns]"
- ]
- },
- "execution_count": 68,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "import random\n",
- "\n",
- "dataset.to_df(\n",
- " # Unnamed transformer must always be defined as a Callable. The function must return a Dictionary\n",
- " lambda event: {'period': event.period.id, 'timestamp': event.timestamp},\n",
- " \n",
- " # Named transformer can be specified as a constant\n",
- " some_columns=1234,\n",
- " \n",
- " # Or as a callable\n",
- " other_column=lambda x: random.randint(0, 255)\n",
- ")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Polars\n",
- "\n",
- "Since version 3.8.0 it's possible to export a `Dataset` to a [Polars](https://www.pola.rs/) dataframe."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 78,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "\n",
- "
\n",
- "shape: (5, 19) \n",
- "\n",
- "\n",
- "\n",
- "event_id\n",
- " \n",
- "\n",
- "event_type\n",
- " \n",
- "\n",
- "result\n",
- " \n",
- "\n",
- "success\n",
- " \n",
- "\n",
- "period_id\n",
- " \n",
- "\n",
- "timestamp\n",
- " \n",
- "\n",
- "end_timestamp\n",
- " \n",
- "\n",
- "ball_state\n",
- " \n",
- "\n",
- "ball_owning_team\n",
- " \n",
- "\n",
- "team_id\n",
- " \n",
- "\n",
- "player_id\n",
- " \n",
- "\n",
- "coordinates_x\n",
- " \n",
- "\n",
- "coordinates_y\n",
- " \n",
- "\n",
- "end_coordinates_x\n",
- " \n",
- "\n",
- "end_coordinates_y\n",
- " \n",
- "\n",
- "receiver_player_id\n",
- " \n",
- "\n",
- "set_piece_type\n",
- " \n",
- "\n",
- "body_part_type\n",
- " \n",
- "\n",
- "pass_type\n",
- " \n",
- " \n",
- "\n",
- "\n",
- "str\n",
- " \n",
- "\n",
- "str\n",
- " \n",
- "\n",
- "str\n",
- " \n",
- "\n",
- "bool\n",
- " \n",
- "\n",
- "i64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "str\n",
- " \n",
- "\n",
- "str\n",
- " \n",
- "\n",
- "str\n",
- " \n",
- "\n",
- "str\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "str\n",
- " \n",
- "\n",
- "str\n",
- " \n",
- "\n",
- "str\n",
- " \n",
- "\n",
- "str\n",
- " \n",
- " \n",
- " \n",
- "\n",
- "\n",
- "\n",
- ""19edeac2-e63f-...\n",
- " \n",
- "\n",
- ""GENERIC:Starti...\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "1\n",
- " \n",
- "\n",
- "0.0\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- ""alive"\n",
- " \n",
- "\n",
- ""909"\n",
- " \n",
- "\n",
- ""909"\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- " \n",
- "\n",
- "\n",
- ""89072e2e-b64f-...\n",
- " \n",
- "\n",
- ""GENERIC:Starti...\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "1\n",
- " \n",
- "\n",
- "0.0\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- ""alive"\n",
- " \n",
- "\n",
- ""909"\n",
- " \n",
- "\n",
- ""914"\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- " \n",
- "\n",
- "\n",
- ""46c6901e-3b12-...\n",
- " \n",
- "\n",
- ""GENERIC:Half S...\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "1\n",
- " \n",
- "\n",
- "0.0\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- ""alive"\n",
- " \n",
- "\n",
- ""909"\n",
- " \n",
- "\n",
- ""914"\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- " \n",
- "\n",
- "\n",
- ""9e5b0646-91cc-...\n",
- " \n",
- "\n",
- ""GENERIC:Half S...\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "1\n",
- " \n",
- "\n",
- "0.0\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- ""alive"\n",
- " \n",
- "\n",
- ""909"\n",
- " \n",
- "\n",
- ""909"\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- " \n",
- "\n",
- "\n",
- ""bbc398f7-c784-...\n",
- " \n",
- "\n",
- ""PASS"\n",
- " \n",
- "\n",
- ""COMPLETE"\n",
- " \n",
- "\n",
- "true\n",
- " \n",
- "\n",
- "1\n",
- " \n",
- "\n",
- "0.878\n",
- " \n",
- "\n",
- "2.788504\n",
- " \n",
- "\n",
- ""alive"\n",
- " \n",
- "\n",
- ""909"\n",
- " \n",
- "\n",
- ""909"\n",
- " \n",
- "\n",
- ""11086"\n",
- " \n",
- "\n",
- "59.95\n",
- " \n",
- "\n",
- "39.95\n",
- " \n",
- "\n",
- "32.45\n",
- " \n",
- "\n",
- "28.75\n",
- " \n",
- "\n",
- ""8963"\n",
- " \n",
- "\n",
- ""KICK_OFF"\n",
- " \n",
- "\n",
- ""RIGHT_FOOT"\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- " \n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- "shape: (5, 19)\n",
- "┌─────────┬──────────┬──────────┬─────────┬─────┬────────────┬────────────┬────────────┬───────────┐\n",
- "│ event_i ┆ event_ty ┆ result ┆ success ┆ ... ┆ receiver_p ┆ set_piece_ ┆ body_part_ ┆ pass_type │\n",
- "│ d ┆ pe ┆ --- ┆ --- ┆ ┆ layer_id ┆ type ┆ type ┆ --- │\n",
- "│ --- ┆ --- ┆ str ┆ bool ┆ ┆ --- ┆ --- ┆ --- ┆ str │\n",
- "│ str ┆ str ┆ ┆ ┆ ┆ str ┆ str ┆ str ┆ │\n",
- "╞═════════╪══════════╪══════════╪═════════╪═════╪════════════╪════════════╪════════════╪═══════════╡\n",
- "│ 19edeac ┆ GENERIC: ┆ null ┆ null ┆ ... ┆ null ┆ null ┆ null ┆ null │\n",
- "│ 2-e63f- ┆ Starting ┆ ┆ ┆ ┆ ┆ ┆ ┆ │\n",
- "│ 4795-8a ┆ XI ┆ ┆ ┆ ┆ ┆ ┆ ┆ │\n",
- "│ 8b-17a6 ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │\n",
- "│ e9fd... ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │\n",
- "│ 89072e2 ┆ GENERIC: ┆ null ┆ null ┆ ... ┆ null ┆ null ┆ null ┆ null │\n",
- "│ e-b64f- ┆ Starting ┆ ┆ ┆ ┆ ┆ ┆ ┆ │\n",
- "│ 4099-84 ┆ XI ┆ ┆ ┆ ┆ ┆ ┆ ┆ │\n",
- "│ 6b-b22c ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │\n",
- "│ f000... ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │\n",
- "│ 46c6901 ┆ GENERIC: ┆ null ┆ null ┆ ... ┆ null ┆ null ┆ null ┆ null │\n",
- "│ e-3b12- ┆ Half ┆ ┆ ┆ ┆ ┆ ┆ ┆ │\n",
- "│ 495a-b6 ┆ Start ┆ ┆ ┆ ┆ ┆ ┆ ┆ │\n",
- "│ 8a-19ca ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │\n",
- "│ 1579... ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │\n",
- "│ 9e5b064 ┆ GENERIC: ┆ null ┆ null ┆ ... ┆ null ┆ null ┆ null ┆ null │\n",
- "│ 6-91cc- ┆ Half ┆ ┆ ┆ ┆ ┆ ┆ ┆ │\n",
- "│ 49a1-bf ┆ Start ┆ ┆ ┆ ┆ ┆ ┆ ┆ │\n",
- "│ 88-39bd ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │\n",
- "│ e773... ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │\n",
- "│ bbc398f ┆ PASS ┆ COMPLETE ┆ true ┆ ... ┆ 8963 ┆ KICK_OFF ┆ RIGHT_FOOT ┆ null │\n",
- "│ 7-c784- ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │\n",
- "│ 4958-a5 ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │\n",
- "│ 04-37b5 ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │\n",
- "│ 83ca... ┆ ┆ ┆ ┆ ┆ ┆ ┆ ┆ │\n",
- "└─────────┴──────────┴──────────┴─────────┴─────┴────────────┴────────────┴────────────┴───────────┘"
- ]
- },
- "execution_count": 78,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "# %pip install polars\n",
- "# you might need to install polars\n",
- "\n",
- "df = dataset.to_df(\n",
- " engine=\"polars\"\n",
- ")\n",
- "df.head()"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## to_records\n",
- "\n",
- "Under the hood the `to_df` method uses the `to_records` method. "
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 69,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "[{'period': 1, 'timestamp': 0.098, 'some_columns': 1234, 'other_column': 42},\n",
- " {'period': 1, 'timestamp': 3.497, 'some_columns': 1234, 'other_column': 72},\n",
- " {'period': 1, 'timestamp': 6.785, 'some_columns': 1234, 'other_column': 135},\n",
- " {'period': 1, 'timestamp': 8.431, 'some_columns': 1234, 'other_column': 100},\n",
- " {'period': 1, 'timestamp': 10.433, 'some_columns': 1234, 'other_column': 193},\n",
- " {'period': 1, 'timestamp': 11.15, 'some_columns': 1234, 'other_column': 64},\n",
- " {'period': 1, 'timestamp': 24.687, 'some_columns': 1234, 'other_column': 22},\n",
- " {'period': 1, 'timestamp': 30.008, 'some_columns': 1234, 'other_column': 157},\n",
- " {'period': 1, 'timestamp': 34.738, 'some_columns': 1234, 'other_column': 73},\n",
- " {'period': 1, 'timestamp': 37.467, 'some_columns': 1234, 'other_column': 226}]"
- ]
- },
- "execution_count": 69,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "records = dataset.to_records(\n",
- " # Unnamed transformer must always be defined as a Callable. The function must return a Dictionary\n",
- " lambda event: {'period': event.period.id, 'timestamp': event.timestamp},\n",
- " \n",
- " # Named transformer can be specified as a constant\n",
- " some_columns=1234,\n",
- " \n",
- " # Or as a callable\n",
- " other_column=lambda x: random.randint(0, 255)\n",
- ")\n",
- "records[:10]"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## EventFactory\n",
- "\n",
- "In some cases like to use your own `Event` classes. This can be useful when you need certain data that isn't stored in the regular `Event` classes"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 70,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " statsbomb_xg \n",
- " player \n",
- " timestamp \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " 0.075164 \n",
- " Lionel Andrés Messi Cuccittini \n",
- " 149.094 \n",
- " \n",
- " \n",
- " 1 \n",
- " 0.062892 \n",
- " Jordi Alba Ramos \n",
- " 339.239 \n",
- " \n",
- " \n",
- " 2 \n",
- " 0.020535 \n",
- " Lionel Andrés Messi Cuccittini \n",
- " 928.625 \n",
- " \n",
- " \n",
- " 3 \n",
- " 0.096234 \n",
- " Rubén Sobrino Pozuelo \n",
- " 979.616 \n",
- " \n",
- " \n",
- " 4 \n",
- " 0.035420 \n",
- " Luis Alberto Suárez Díaz \n",
- " 1095.914 \n",
- " \n",
- " \n",
- " 5 \n",
- " 0.089920 \n",
- " Ousmane Dembélé \n",
- " 1842.287 \n",
- " \n",
- " \n",
- " 6 \n",
- " 0.071365 \n",
- " Ivan Rakitić \n",
- " 2104.861 \n",
- " \n",
- " \n",
- " 7 \n",
- " 0.078886 \n",
- " Lionel Andrés Messi Cuccittini \n",
- " 2248.168 \n",
- " \n",
- " \n",
- " 8 \n",
- " 0.171218 \n",
- " Gerard Piqué Bernabéu \n",
- " 2250.989 \n",
- " \n",
- " \n",
- " 9 \n",
- " 0.226095 \n",
- " Ousmane Dembélé \n",
- " 2308.083 \n",
- " \n",
- " \n",
- " 10 \n",
- " 0.257290 \n",
- " Luis Alberto Suárez Díaz \n",
- " 2434.592 \n",
- " \n",
- " \n",
- " 11 \n",
- " 0.145402 \n",
- " Ousmane Dembélé \n",
- " 2610.612 \n",
- " \n",
- " \n",
- " 12 \n",
- " 0.143644 \n",
- " Jordi Alba Ramos \n",
- " 2864.792 \n",
- " \n",
- " \n",
- " 13 \n",
- " 0.034266 \n",
- " Mubarak Wakaso \n",
- " 3072.668 \n",
- " \n",
- " \n",
- " 14 \n",
- " 0.018334 \n",
- " Luis Alberto Suárez Díaz \n",
- " 3239.623 \n",
- " \n",
- " \n",
- " 15 \n",
- " 0.014615 \n",
- " Philippe Coutinho Correia \n",
- " 3301.656 \n",
- " \n",
- " \n",
- " 16 \n",
- " 0.039418 \n",
- " Jordi Alba Ramos \n",
- " 3339.758 \n",
- " \n",
- " \n",
- " 17 \n",
- " 0.026228 \n",
- " Lionel Andrés Messi Cuccittini \n",
- " 3446.115 \n",
- " \n",
- " \n",
- " 18 \n",
- " 0.031532 \n",
- " Philippe Coutinho Correia \n",
- " 3641.424 \n",
- " \n",
- " \n",
- " 19 \n",
- " 0.137812 \n",
- " Lionel Andrés Messi Cuccittini \n",
- " 3797.222 \n",
- " \n",
- " \n",
- " 20 \n",
- " 0.081403 \n",
- " Lionel Andrés Messi Cuccittini \n",
- " 3948.856 \n",
- " \n",
- " \n",
- " 21 \n",
- " 0.009953 \n",
- " Ivan Rakitić \n",
- " 4118.643 \n",
- " \n",
- " \n",
- " 22 \n",
- " 0.337188 \n",
- " Luis Alberto Suárez Díaz \n",
- " 4352.760 \n",
- " \n",
- " \n",
- " 23 \n",
- " 0.137859 \n",
- " Adrián Marín Gómez \n",
- " 4702.947 \n",
- " \n",
- " \n",
- " 24 \n",
- " 0.379632 \n",
- " Philippe Coutinho Correia \n",
- " 4896.874 \n",
- " \n",
- " \n",
- " 25 \n",
- " 0.086874 \n",
- " Philippe Coutinho Correia \n",
- " 4966.846 \n",
- " \n",
- " \n",
- " 26 \n",
- " 0.262502 \n",
- " Lionel Andrés Messi Cuccittini \n",
- " 5367.906 \n",
- " \n",
- " \n",
- " 27 \n",
- " 0.289481 \n",
- " Lionel Andrés Messi Cuccittini \n",
- " 5508.038 \n",
- " \n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " statsbomb_xg player timestamp\n",
- "0 0.075164 Lionel Andrés Messi Cuccittini 149.094\n",
- "1 0.062892 Jordi Alba Ramos 339.239\n",
- "2 0.020535 Lionel Andrés Messi Cuccittini 928.625\n",
- "3 0.096234 Rubén Sobrino Pozuelo 979.616\n",
- "4 0.035420 Luis Alberto Suárez Díaz 1095.914\n",
- "5 0.089920 Ousmane Dembélé 1842.287\n",
- "6 0.071365 Ivan Rakitić 2104.861\n",
- "7 0.078886 Lionel Andrés Messi Cuccittini 2248.168\n",
- "8 0.171218 Gerard Piqué Bernabéu 2250.989\n",
- "9 0.226095 Ousmane Dembélé 2308.083\n",
- "10 0.257290 Luis Alberto Suárez Díaz 2434.592\n",
- "11 0.145402 Ousmane Dembélé 2610.612\n",
- "12 0.143644 Jordi Alba Ramos 2864.792\n",
- "13 0.034266 Mubarak Wakaso 3072.668\n",
- "14 0.018334 Luis Alberto Suárez Díaz 3239.623\n",
- "15 0.014615 Philippe Coutinho Correia 3301.656\n",
- "16 0.039418 Jordi Alba Ramos 3339.758\n",
- "17 0.026228 Lionel Andrés Messi Cuccittini 3446.115\n",
- "18 0.031532 Philippe Coutinho Correia 3641.424\n",
- "19 0.137812 Lionel Andrés Messi Cuccittini 3797.222\n",
- "20 0.081403 Lionel Andrés Messi Cuccittini 3948.856\n",
- "21 0.009953 Ivan Rakitić 4118.643\n",
- "22 0.337188 Luis Alberto Suárez Díaz 4352.760\n",
- "23 0.137859 Adrián Marín Gómez 4702.947\n",
- "24 0.379632 Philippe Coutinho Correia 4896.874\n",
- "25 0.086874 Philippe Coutinho Correia 4966.846\n",
- "26 0.262502 Lionel Andrés Messi Cuccittini 5367.906\n",
- "27 0.289481 Lionel Andrés Messi Cuccittini 5508.038"
- ]
- },
- "execution_count": 70,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "from dataclasses import dataclass\n",
- "\n",
- "from kloppy.domain import EventFactory, create_event, ShotEvent\n",
- "from kloppy import statsbomb\n",
- "\n",
- "\n",
- "@dataclass(repr=False)\n",
- "class StatsBombShotEvent(ShotEvent):\n",
- " statsbomb_xg: float = None\n",
- " \n",
- " \n",
- "class StatsBombEventFactory(EventFactory):\n",
- " def build_shot(self, **kwargs) -> ShotEvent:\n",
- " kwargs['statsbomb_xg'] = kwargs['raw_event']['shot']['statsbomb_xg']\n",
- " return create_event(StatsBombShotEvent, **kwargs)\n",
- " \n",
- " \n",
- "event_factory = StatsBombEventFactory()\n",
- "\n",
- "dataset = statsbomb.load_open_data(event_factory=event_factory)\n",
- "\n",
- "dataset.filter(\"shot\").to_df(\n",
- " \"statsbomb_xg\",\n",
- " \"player\",\n",
- " timestamp=lambda event: event.period.start_timestamp + event.timestamp,\n",
- ")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Freeze frame\n",
- "\n",
- "For event data it's very useful to have additional context about the event. This can be a metric like packing or xG, but also the frame of tracking data. This freeze frame contains player coordinates. Some providers retrieve the information from broadcast video feeds and therefore only the coordinates of players visible in the feed are known.\n",
- "Furthermore the vendor might include only the team of the player, and not a player identifier."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 71,
- "metadata": {},
- "outputs": [],
- "source": [
- "dataset = statsbomb.load_open_data(\n",
- " match_id='3788741',\n",
- " coordinates=\"statsbomb\"\n",
- ")"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 72,
- "metadata": {},
- "outputs": [],
- "source": [
- "event = dataset.find(\"shot\")"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 73,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "image/png": "iVBORw0KGgoAAAANSUhEUgAAAnYAAAG3CAYAAAA5CBh1AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6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AAAQxDsAAAADEGwAwAAMATBDgAAwBAEOwAAAEMQ7AAAAAxBsAMAADAEwQ4AAMAQBDsAAABDEOwAAAAMQbADAAAwBMEOAADAEAQ7AAAAQxDsAAAADBEO6sDVek2vnj8T1OEBdJFqveb9l/MOAD/snHf85nuws+2QpN2TLAD4ifMOAD81c49/fA92U9lx5fLzcpyG34cG0KVaw1w0HAmwEgDdxLZDmsqO+3pMy3Vd19cjAgAAoC2YPAEAAGAIgh0AAIAhCHYAAACGINgBAAAYgmAHAABgCIIdAACAIQh2AAAAhiDYAQAAGIJgBwAAYAiCHQAAgCEIdgAAAIYg2AEAABiCYAcAAGAIgh0AAIAhCHYAAACGINgBAAAYgmAHAABgCIIdAACAIQh2AAAAhiDYAQAAGIJgBwAAYAiCHQAAgCEIdgAAAIYg2AEAABiCYAcAAGAIgh0AAIAh/j8u91Af0gLW9wAAAABJRU5ErkJggg==",
- "text/plain": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
- "source": [
- "# You might need to install mplsoccer package\n",
- "# %pip install mplsoccer\n",
- "\n",
- "from mplsoccer.pitch import Pitch\n",
- "\n",
- "home_team = dataset.metadata.teams[0]\n",
- "\n",
- "pitch = Pitch(pitch_type='statsbomb',\n",
- " pitch_color='white', line_color='#c7d5cc')\n",
- "fig, ax = pitch.draw()\n",
- "\n",
- "def get_color(player):\n",
- " if player == event.player:\n",
- " return \"blue\"\n",
- " elif player.team == event.player.team:\n",
- " return \"green\"\n",
- " elif player.position.position_id == '1':\n",
- " return \"black\"\n",
- " else:\n",
- " return \"grey\"\n",
- "\n",
- "x, y, color = zip(*[\n",
- " (coordinates.x, coordinates.y, get_color(player))\n",
- " for player, coordinates in event.freeze_frame.players_coordinates.items()\n",
- "])\n",
- "\n",
- "_ = pitch.scatter(x, y, color=color, ax=ax)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "kloppy-venv",
- "language": "python",
- "name": "kloppy-venv"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.10.13"
- },
- "toc": {
- "base_numbering": 1,
- "nav_menu": {},
- "number_sections": true,
- "sideBar": true,
- "skip_h1_title": false,
- "title_cell": "Table of Contents",
- "title_sidebar": "Contents",
- "toc_cell": false,
- "toc_position": {},
- "toc_section_display": true,
- "toc_window_display": false
- }
- },
- "nbformat": 4,
- "nbformat_minor": 4
-}
diff --git a/docs/examples/navigating.ipynb b/docs/examples/navigating.ipynb
deleted file mode 100644
index d4186e92..00000000
--- a/docs/examples/navigating.ipynb
+++ /dev/null
@@ -1,525 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "id": "d5e58e18",
- "metadata": {},
- "source": [
- "# Navigating\n",
- "\n",
- "Kloppy 3.2 adds some powerfull tools to navigate through you event data. In this tutorial you will learn how to use them.\n",
- "\n",
- "\n",
- "## Dataset\n",
- "\n",
- "On dataset level it's possible to use `filter`, `find` and `find_all`. All these functions access the same argument for finding the right events.\n",
- "You can pass a string or a function. In case of a string is must be either 'event_type', 'event_type.result' or '.result'. Some examples: 'shot.goal', 'pass' or '.complete'.\n",
- "\n",
- "Lets have a look at how these work.\n",
- "\n",
- "\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 1,
- "id": "c910dd35",
- "metadata": {},
- "outputs": [
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "/Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages/kloppy-3.7.1-py3.10.egg/kloppy/_providers/statsbomb.py:67: UserWarning: \n",
- "\n",
- "You are about to use StatsBomb public data.\n",
- "By using this data, you are agreeing to the user agreement. \n",
- "The user agreement can be found here: https://github.com/statsbomb/open-data/blob/master/LICENSE.pdf\n",
- "\n",
- " warnings.warn(\n"
- ]
- },
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " event_id \n",
- " event_type \n",
- " result \n",
- " success \n",
- " period_id \n",
- " timestamp \n",
- " end_timestamp \n",
- " ball_state \n",
- " ball_owning_team \n",
- " team_id \n",
- " player_id \n",
- " coordinates_x \n",
- " coordinates_y \n",
- " end_coordinates_x \n",
- " end_coordinates_y \n",
- " body_part_type \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " 4c7c4ab1-6b9f-4504-a237-249c2e0c549f \n",
- " SHOT \n",
- " GOAL \n",
- " True \n",
- " 2 \n",
- " 1091.954 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5503 \n",
- " 0.800417 \n",
- " 0.563125 \n",
- " None \n",
- " None \n",
- " LEFT_FOOT \n",
- " \n",
- " \n",
- " 1 \n",
- " 683c6752-13bc-4892-94ed-22e1c938f1f7 \n",
- " SHOT \n",
- " GOAL \n",
- " True \n",
- " 2 \n",
- " 2261.578 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 3501 \n",
- " 0.875417 \n",
- " 0.388125 \n",
- " None \n",
- " None \n",
- " RIGHT_FOOT \n",
- " \n",
- " \n",
- " 2 \n",
- " 55d71847-9511-4417-aea9-6f415e279011 \n",
- " SHOT \n",
- " GOAL \n",
- " True \n",
- " 2 \n",
- " 2802.770 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5503 \n",
- " 0.932917 \n",
- " 0.431875 \n",
- " None \n",
- " None \n",
- " LEFT_FOOT \n",
- " \n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " event_id event_type result success period_id \\\n",
- "0 4c7c4ab1-6b9f-4504-a237-249c2e0c549f SHOT GOAL True 2 \n",
- "1 683c6752-13bc-4892-94ed-22e1c938f1f7 SHOT GOAL True 2 \n",
- "2 55d71847-9511-4417-aea9-6f415e279011 SHOT GOAL True 2 \n",
- "\n",
- " timestamp end_timestamp ball_state ball_owning_team team_id player_id \\\n",
- "0 1091.954 None alive 217 217 5503 \n",
- "1 2261.578 None alive 217 217 3501 \n",
- "2 2802.770 None alive 217 217 5503 \n",
- "\n",
- " coordinates_x coordinates_y end_coordinates_x end_coordinates_y \\\n",
- "0 0.800417 0.563125 None None \n",
- "1 0.875417 0.388125 None None \n",
- "2 0.932917 0.431875 None None \n",
- "\n",
- " body_part_type \n",
- "0 LEFT_FOOT \n",
- "1 RIGHT_FOOT \n",
- "2 LEFT_FOOT "
- ]
- },
- "execution_count": 1,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "from kloppy import statsbomb\n",
- "\n",
- "# Load a Statsbomb open data dataset\n",
- "dataset = statsbomb.load_open_data()\n",
- "\n",
- "# Create a new dataset which contains all goals\n",
- "filtered_dataset = dataset.filter('shot.goal')\n",
- "\n",
- "# Show the results\n",
- "filtered_dataset.to_df()"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "6fe919e7",
- "metadata": {},
- "source": [
- "The filtered dataset doesn't contain any events other than goals. Lets validate that. When we try to find all passes we should get an empty list"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 2,
- "id": "57aac560",
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "0"
- ]
- },
- "execution_count": 2,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "passes = filtered_dataset.find_all('pass')\n",
- "len(passes)"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "4cd3edb8",
- "metadata": {},
- "source": [
- "The original dataset does contain passes, right?"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 3,
- "id": "45de2f06",
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "1132"
- ]
- },
- "execution_count": 3,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "passes = dataset.find_all('pass')\n",
- "len(passes)"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "3239a684",
- "metadata": {},
- "source": [
- "Now we already touched the `find_all` method. This method accepts the same argument. The difference is that `find_all` returns a list of events, where `filter` returns a new Dataset. The `find` method return the first matching event or None when it cannot find one."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 4,
- "id": "2df283f7",
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- ""
- ]
- },
- "execution_count": 4,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "dataset.find('shot')"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 5,
- "id": "7c432ca0",
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "None\n"
- ]
- }
- ],
- "source": [
- "print(filtered_dataset.find('pass'))"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "4b5120a9",
- "metadata": {},
- "source": [
- "## Event\n",
- "\n",
- "On Event level there are also some new methods for navigating. The `prev` and `next` methods are added. These allow you to quickly find previous or next events. But those two methods also accept the filter argument like the Dataset methods do. This makes useful to find a certain type of event instead of just the one before/after.\n",
- "\n",
- "Lets have look at how this works"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 6,
- "id": "31fd93a8",
- "metadata": {},
- "outputs": [
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "/Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages/kloppy-3.7.1-py3.10.egg/kloppy/_providers/statsbomb.py:67: UserWarning: \n",
- "\n",
- "You are about to use StatsBomb public data.\n",
- "By using this data, you are agreeing to the user agreement. \n",
- "The user agreement can be found here: https://github.com/statsbomb/open-data/blob/master/LICENSE.pdf\n",
- "\n",
- " warnings.warn(\n"
- ]
- },
- {
- "data": {
- "text/plain": [
- ""
- ]
- },
- "execution_count": 6,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "# Load a Statsbomb open data dataset\n",
- "dataset = statsbomb.load_open_data()\n",
- "\n",
- "first_goal = dataset.find('shot.goal')\n",
- "first_goal"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 7,
- "id": "98dda35c",
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "\n",
- "\n",
- "\n"
- ]
- }
- ],
- "source": [
- "# Lets previous and next events\n",
- "print(first_goal.prev())\n",
- "print(first_goal)\n",
- "print(first_goal.next())"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "9be4a6a1",
- "metadata": {},
- "source": [
- "But what if we want to find the last complete pass before the goal?"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 8,
- "id": "841fa959",
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- ""
- ]
- },
- "execution_count": 8,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "first_goal.prev('pass.complete')"
- ]
- },
- {
- "cell_type": "markdown",
- "id": "b7026192",
- "metadata": {},
- "source": [
- "Or when we don't care about the event type, but want to make sure it's complete.."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 9,
- "id": "16aad417",
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- ""
- ]
- },
- "execution_count": 9,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "first_goal.prev('.complete')\n",
- " "
- ]
- },
- {
- "cell_type": "markdown",
- "id": "9b5514bd",
- "metadata": {},
- "source": [
- "## Related events\n",
- "\n",
- "Some vendors include `related_events` in their data. The related events can be accessed via `get_related_events` method, or by `related_pass`, `related_carry`, etc for each event type.\n",
- "\n",
- "The `get_related_events` returns a list which can be empty. The `related_pass` methods return an Event or None when that type is not specified."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 10,
- "id": "963e687d",
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "[,\n",
- " ,\n",
- " ,\n",
- " ]"
- ]
- },
- "execution_count": 10,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "carry_event = first_goal.prev('carry')\n",
- "carry_event.get_related_events()"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 11,
- "id": "7d2c3377",
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "None\n"
- ]
- }
- ],
- "source": [
- "print(carry_event.related_pass())"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 12,
- "id": "3e53ee99",
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "\n"
- ]
- }
- ],
- "source": [
- "print(carry_event.related_take_on())"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "id": "2ed402bd",
- "metadata": {},
- "outputs": [],
- "source": []
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "kloppy-venv",
- "language": "python",
- "name": "kloppy-venv"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.10.6"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 5
-}
diff --git a/docs/examples/plotting.ipynb b/docs/examples/plotting.ipynb
deleted file mode 100644
index 69263838..00000000
--- a/docs/examples/plotting.ipynb
+++ /dev/null
@@ -1,166 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Plotting\n",
- "\n",
- "In this quickstart, we'll show all kind of examples. As PySport encourages OpenSource projects, all examples use other sports analytics packages in combination with kloppy. You can find more packages at https://opensource.pysport.org/\n",
- "\n",
- "\n",
- "## Plotting events using mplsoccer\n",
- "\n",
- "In this example the [mplsoccer](https://github.com/andrewRowlinson/mplsoccer) package by [Andy Rowlinson](https://twitter.com/numberstorm) is used.\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 1,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Requirement already satisfied: mplsoccer in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages (1.1.10)\n",
- "Requirement already satisfied: matplotlib in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages (3.7.1)\n",
- "Requirement already satisfied: seaborn in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages (0.12.2)\n",
- "Requirement already satisfied: pandas in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages (from mplsoccer) (2.0.3)\n",
- "Requirement already satisfied: numpy in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages (from mplsoccer) (1.24.2)\n",
- "Requirement already satisfied: pillow in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages (from mplsoccer) (9.4.0)\n",
- "Requirement already satisfied: scipy in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages (from mplsoccer) (1.10.1)\n",
- "Requirement already satisfied: requests in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages/requests-2.28.2-py3.10.egg (from mplsoccer) (2.28.2)\n",
- "Requirement already satisfied: cycler>=0.10 in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages (from matplotlib) (0.11.0)\n",
- "Requirement already satisfied: pyparsing>=2.3.1 in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages (from matplotlib) (3.0.9)\n",
- "Requirement already satisfied: contourpy>=1.0.1 in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages (from matplotlib) (1.0.7)\n",
- "Requirement already satisfied: python-dateutil>=2.7 in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages/python_dateutil-2.8.2-py3.10.egg (from matplotlib) (2.8.2)\n",
- "Requirement already satisfied: packaging>=20.0 in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages (from matplotlib) (23.0)\n",
- "Requirement already satisfied: kiwisolver>=1.0.1 in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages (from matplotlib) (1.4.4)\n",
- "Requirement already satisfied: fonttools>=4.22.0 in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages (from matplotlib) (4.38.0)\n",
- "Requirement already satisfied: tzdata>=2022.1 in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages (from pandas->mplsoccer) (2023.3)\n",
- "Requirement already satisfied: pytz>=2020.1 in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages/pytz-2022.7.1-py3.10.egg (from pandas->mplsoccer) (2022.7.1)\n",
- "Requirement already satisfied: six>=1.5 in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages/six-1.16.0-py3.10.egg (from python-dateutil>=2.7->matplotlib) (1.16.0)\n",
- "Requirement already satisfied: charset-normalizer<4,>=2 in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages/charset_normalizer-3.0.1-py3.10-macosx-12-arm64.egg (from requests->mplsoccer) (3.0.1)\n",
- "Requirement already satisfied: idna<4,>=2.5 in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages/idna-3.4-py3.10.egg (from requests->mplsoccer) (3.4)\n",
- "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages/urllib3-1.26.14-py3.10.egg (from requests->mplsoccer) (1.26.14)\n",
- "Requirement already satisfied: certifi>=2017.4.17 in /Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages/certifi-2022.12.7-py3.10.egg (from requests->mplsoccer) (2022.12.7)\n",
- "\n",
- "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.0.1\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m24.0\u001b[0m\n",
- "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\n"
- ]
- }
- ],
- "source": [
- "import sys\n",
- "!{sys.executable} -m pip install mplsoccer matplotlib seaborn"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 2,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Going to show passes of: Lionel Andrés Messi Cuccittini\n"
- ]
- }
- ],
- "source": [
- "## Load data\n",
- "\n",
- "from mplsoccer.pitch import Pitch\n",
- "from kloppy import statsbomb\n",
- "\n",
- "dataset = statsbomb.load_open_data(\n",
- " event_types=[\"pass\"], \n",
- " coordinates=\"statsbomb\"\n",
- ")\n",
- "\n",
- "home_team, away_team = dataset.metadata.teams\n",
- "\n",
- "messi = home_team.players[9]\n",
- "print(f\"Going to show passes of: {messi}\")"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 3,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "image/png": "iVBORw0KGgoAAAANSUhEUgAAAnYAAAG3CAYAAAA5CBh1AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAABWZElEQVR4nO3dfbBteV3f+e8+557bl+5LNw39SKOpNk7IFZOyepCgGZnKaBwzwygZVBSFYARFIxkDlenJYJLWABEQQ2TGaGqCIRNKCC2NQ8pMppJMBCRBJ2QmPdgFadI1kfvQQIAm3dj3nHv2nj/OXfuuvfbv4ft7XL+19vtVdapOn732Wuuc03fvz/l+fw+L1Wq1EgAAAEze3tg3AAAAgDwIdgAAADNBsAMAAJgJgh0AAMBMEOwAAABmgmAHAAAwEwQ7AACAmSDYAQAAzATBDgAAYCZOaQ+89OWjkvcBAAAAiztuPFAdR8UOAABgJ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/k8vFCTi9EDlfXHj+zt5InLTPYbtoTeWx58qZ4uFyKyMkb5vHx8cZxe/unZHl8RURO3nhX3ed7p2S1PPlc9k+JHHefH4gcH62fv9o/JYvuMZGTN/7lld7jB7LoHd8Fhr3e17rjRMR4rPH4fmDoXa+7p/Vjx4PHBuFo+FxTuBte23Qel+E1Qp/f0e66YVomxnYeV/gODnQio8x+FWk31E1hFmyLduBbBFCDpnIXW7Xrv4Dn2EM2ZvmTPlu1RF25s425E/G2ZkUcbVdLBUtbUds+3ynRVvO0VT3XvfjuT1vxc13Pdi7TGDrn+DtHu7xGqBtW7aYY6lwIdfFGq9g9eumi3HPu7rEuD6CAt7//Qe8xp/dXcmiowPWrbiInL8KHy7j7GFbtQly/t5KvLBfrqt3JvZxU7vpVu361LrhyJ7JRveve8NcVsu6NfVC9OzkmroLXP77jquSJuKt5G/frOIfpPKZ7KcUVBDW7dITsCLIVqhNaryLpO0qItB3qao2rqxnoQgNsCdWD3Q1nT/6qXy6XcvHC+dqXB1DQS57/9LFvAQCa0uWeWqoHu3tff5+8+Y33yROPlxmPAwBD/T8i73zmXSPeCYBdcsPZs3Lv6++res3FarVS1Q0vfXl7ACwAAADKu+NG3fCFHRlKCAAAMH8EOwAAgJkg2AEAAMwEwQ4AAGAmCHYAAAAzQbADAACYCYIdAADATBDsAAAAZoJgBwAAMBMEOwAAgJkg2AEAAMwEwQ4AAGAmCHYAAAAzQbADAACYCYIdAADATBDsAAAAZmKxWq1WY98EAAAA0lGxAwAAmAmCHQAAwEwQ7AAAAGaCYAcAADATBDsAAICZINgBAADMBMEOAABgJgh2AAAAM0GwAwAAmIn/H+q/5TJoF86UAAAAAElFTkSuQmCC",
- "text/plain": [
- ""
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- }
- ],
- "source": [
- "df = (\n",
- " dataset\n",
- " .filter(lambda event: event.player == messi)\n",
- " .to_df()\n",
- ")\n",
- "\n",
- "\n",
- "pitch = Pitch(pitch_color='#e7f1fa', line_zorder=1, line_color='black', pitch_type=\"statsbomb\")\n",
- "fig, ax = pitch.draw()\n",
- "plot = pitch.kdeplot(\n",
- " df[\"coordinates_x\"],\n",
- " df[\"coordinates_y\"],\n",
- " ax=ax,\n",
- " fill=True,\n",
- " n_levels=50,\n",
- ")"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "Python 3 (ipykernel)",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.10.13"
- },
- "toc": {
- "base_numbering": 1,
- "nav_menu": {},
- "number_sections": true,
- "sideBar": true,
- "skip_h1_title": false,
- "title_cell": "Table of Contents",
- "title_sidebar": "Contents",
- "toc_cell": false,
- "toc_position": {},
- "toc_section_display": true,
- "toc_window_display": false
- }
- },
- "nbformat": 4,
- "nbformat_minor": 4
-}
diff --git a/docs/examples/state.ipynb b/docs/examples/state.ipynb
deleted file mode 100644
index 32226afe..00000000
--- a/docs/examples/state.ipynb
+++ /dev/null
@@ -1,1427 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# State\n",
- "\n",
- "While working with event data it can be convenient to also use the current score. This can be used to determine if a team is winning, losing or drawing. A more generic name for the score is 'state'. \n",
- "\n",
- "In this quickstart we'll look at how to use the `add_state` method of kloppy to add state to the events for later use.\n",
- "\n",
- "## Loading some statsbomb data\n",
- "\n",
- "First we'll load Barcelona - Deportivo Alaves from the statsbomb open-data project."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 31,
- "metadata": {},
- "outputs": [
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "/Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages/kloppy-3.7.1-py3.10.egg/kloppy/_providers/statsbomb.py:67: UserWarning: \n",
- "\n",
- "You are about to use StatsBomb public data.\n",
- "By using this data, you are agreeing to the user agreement. \n",
- "The user agreement can be found here: https://github.com/statsbomb/open-data/blob/master/LICENSE.pdf\n",
- "\n",
- " warnings.warn(\n"
- ]
- },
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "['Barcelona', 'Deportivo Alavés']\n",
- "{}\n"
- ]
- }
- ],
- "source": [
- "from kloppy import statsbomb\n",
- "from kloppy.domain import EventType\n",
- "\n",
- "dataset = statsbomb.load_open_data()\n",
- "print([team.name for team in dataset.metadata.teams])\n",
- "print(dataset.events[0].state)"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Add state - score\n",
- "\n",
- "kloppy contains some default state builders: score, lineup and sequence. Let's have a look at the `score` state builder. "
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 32,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "{'score': Score(home=0, away=0)}"
- ]
- },
- "execution_count": 32,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "dataset = dataset.add_state('score')\n",
- "\n",
- "dataset.events[0].state"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "As you can see `state` is now filled with a score object. The object contains two attributes: `home` and `away`. Every event contains a score object which is automatically updated when a goal is scored.\n",
- "\n",
- "Now lets have a look at how we can use the score state. First we filter on only shots."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 33,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "28"
- ]
- },
- "execution_count": 33,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "dataset = dataset.filter(lambda event: event.event_type == EventType.SHOT)\n",
- "shots = dataset.events\n",
- "len(shots)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 34,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "0-0 Barcelona - Lionel Andrés Messi Cuccittini - OFF_TARGET\n",
- "0-0 Barcelona - Jordi Alba Ramos - OFF_TARGET\n",
- "0-0 Barcelona - Lionel Andrés Messi Cuccittini - SAVED\n",
- "0-0 Deportivo Alavés - Rubén Sobrino Pozuelo - OFF_TARGET\n",
- "0-0 Barcelona - Luis Alberto Suárez Díaz - OFF_TARGET\n",
- "0-0 Barcelona - Ousmane Dembélé - OFF_TARGET\n",
- "0-0 Barcelona - Ivan Rakitić - OFF_TARGET\n",
- "0-0 Barcelona - Lionel Andrés Messi Cuccittini - POST\n",
- "0-0 Barcelona - Gerard Piqué Bernabéu - OFF_TARGET\n",
- "0-0 Barcelona - Ousmane Dembélé - SAVED\n",
- "0-0 Barcelona - Luis Alberto Suárez Díaz - OFF_TARGET\n",
- "0-0 Barcelona - Ousmane Dembélé - OFF_TARGET\n",
- "0-0 Barcelona - Jordi Alba Ramos - SAVED\n",
- "0-0 Deportivo Alavés - Mubarak Wakaso - BLOCKED\n",
- "0-0 Barcelona - Luis Alberto Suárez Díaz - BLOCKED\n",
- "0-0 Barcelona - Philippe Coutinho Correia - BLOCKED\n",
- "0-0 Barcelona - Jordi Alba Ramos - BLOCKED\n",
- "0-0 Barcelona - Lionel Andrés Messi Cuccittini - OFF_TARGET\n",
- "0-0 Barcelona - Philippe Coutinho Correia - BLOCKED\n",
- "0-0 Barcelona - Lionel Andrés Messi Cuccittini - GOAL\n",
- "1-0 Barcelona - Lionel Andrés Messi Cuccittini - POST\n",
- "1-0 Barcelona - Ivan Rakitić - BLOCKED\n",
- "1-0 Barcelona - Luis Alberto Suárez Díaz - SAVED\n",
- "1-0 Deportivo Alavés - Adrián Marín Gómez - OFF_TARGET\n",
- "1-0 Barcelona - Philippe Coutinho Correia - SAVED\n",
- "1-0 Barcelona - Philippe Coutinho Correia - GOAL\n",
- "2-0 Barcelona - Lionel Andrés Messi Cuccittini - SAVED\n",
- "2-0 Barcelona - Lionel Andrés Messi Cuccittini - GOAL\n"
- ]
- }
- ],
- "source": [
- "for shot in shots:\n",
- " print(shot.state['score'], shot.player.team, '-', shot.player, '-', shot.result)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 35,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " event_id \n",
- " event_type \n",
- " result \n",
- " success \n",
- " period_id \n",
- " timestamp \n",
- " end_timestamp \n",
- " ball_state \n",
- " ball_owning_team \n",
- " team_id \n",
- " player_id \n",
- " coordinates_x \n",
- " coordinates_y \n",
- " end_coordinates_x \n",
- " end_coordinates_y \n",
- " body_part_type \n",
- " home_score \n",
- " away_score \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " 65f16e50-7c5d-4293-b2fc-d20887a772f9 \n",
- " SHOT \n",
- " OFF_TARGET \n",
- " False \n",
- " 1 \n",
- " 149.094 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5503 \n",
- " 0.930417 \n",
- " 0.645625 \n",
- " None \n",
- " None \n",
- " RIGHT_FOOT \n",
- " 0 \n",
- " 0 \n",
- " \n",
- " \n",
- " 1 \n",
- " b0f73423-3990-45ae-9dda-3512c2d1aff3 \n",
- " SHOT \n",
- " OFF_TARGET \n",
- " False \n",
- " 1 \n",
- " 339.239 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5211 \n",
- " 0.949583 \n",
- " 0.336875 \n",
- " None \n",
- " None \n",
- " LEFT_FOOT \n",
- " 0 \n",
- " 0 \n",
- " \n",
- " \n",
- " 2 \n",
- " 13b1ddab-d22e-43d9-bfe4-12632fea1a27 \n",
- " SHOT \n",
- " SAVED \n",
- " False \n",
- " 1 \n",
- " 928.625 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5503 \n",
- " 0.766250 \n",
- " 0.430625 \n",
- " None \n",
- " None \n",
- " LEFT_FOOT \n",
- " 0 \n",
- " 0 \n",
- " \n",
- " \n",
- " 3 \n",
- " 391bfb74-07a6-4afe-9568-02a9b23f5bd4 \n",
- " SHOT \n",
- " OFF_TARGET \n",
- " False \n",
- " 1 \n",
- " 979.616 \n",
- " None \n",
- " alive \n",
- " 206 \n",
- " 206 \n",
- " 6613 \n",
- " 0.908750 \n",
- " 0.483125 \n",
- " None \n",
- " None \n",
- " HEAD \n",
- " 0 \n",
- " 0 \n",
- " \n",
- " \n",
- " 4 \n",
- " 5e55f5a5-954f-4cc4-ba6e-a9cf6d6e249e \n",
- " SHOT \n",
- " OFF_TARGET \n",
- " False \n",
- " 1 \n",
- " 1095.914 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5246 \n",
- " 0.891250 \n",
- " 0.311875 \n",
- " None \n",
- " None \n",
- " RIGHT_FOOT \n",
- " 0 \n",
- " 0 \n",
- " \n",
- " \n",
- " 5 \n",
- " 1c0347cd-14dc-4aa8-91eb-520672a6cfe1 \n",
- " SHOT \n",
- " OFF_TARGET \n",
- " False \n",
- " 1 \n",
- " 1842.287 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5477 \n",
- " 0.900417 \n",
- " 0.341875 \n",
- " None \n",
- " None \n",
- " LEFT_FOOT \n",
- " 0 \n",
- " 0 \n",
- " \n",
- " \n",
- " 6 \n",
- " 7c3182af-c8a8-4c7c-934e-5c41c7b93c6a \n",
- " SHOT \n",
- " OFF_TARGET \n",
- " False \n",
- " 1 \n",
- " 2104.861 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5470 \n",
- " 0.932917 \n",
- " 0.545625 \n",
- " None \n",
- " None \n",
- " HEAD \n",
- " 0 \n",
- " 0 \n",
- " \n",
- " \n",
- " 7 \n",
- " 39f231e5-0072-461c-beb0-a9bedb420f83 \n",
- " SHOT \n",
- " POST \n",
- " False \n",
- " 1 \n",
- " 2248.168 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5503 \n",
- " 0.807917 \n",
- " 0.674375 \n",
- " None \n",
- " None \n",
- " LEFT_FOOT \n",
- " 0 \n",
- " 0 \n",
- " \n",
- " \n",
- " 8 \n",
- " 062cdd08-8773-424f-8fc5-2e3d441c3c5c \n",
- " SHOT \n",
- " OFF_TARGET \n",
- " False \n",
- " 1 \n",
- " 2250.989 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5213 \n",
- " 0.935417 \n",
- " 0.516875 \n",
- " None \n",
- " None \n",
- " HEAD \n",
- " 0 \n",
- " 0 \n",
- " \n",
- " \n",
- " 9 \n",
- " c09e904d-6c8e-479d-af2e-c2c5863aca71 \n",
- " SHOT \n",
- " SAVED \n",
- " False \n",
- " 1 \n",
- " 2308.083 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5477 \n",
- " 0.853750 \n",
- " 0.364375 \n",
- " None \n",
- " None \n",
- " RIGHT_FOOT \n",
- " 0 \n",
- " 0 \n",
- " \n",
- " \n",
- " 10 \n",
- " 9eda2385-88bb-4c37-b039-a738c4cd8d4b \n",
- " SHOT \n",
- " OFF_TARGET \n",
- " False \n",
- " 1 \n",
- " 2434.592 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5246 \n",
- " 0.910417 \n",
- " 0.370625 \n",
- " None \n",
- " None \n",
- " RIGHT_FOOT \n",
- " 0 \n",
- " 0 \n",
- " \n",
- " \n",
- " 11 \n",
- " 0b56df83-958e-4a31-9e5a-d741b4bf95cf \n",
- " SHOT \n",
- " OFF_TARGET \n",
- " False \n",
- " 1 \n",
- " 2610.612 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5477 \n",
- " 0.887083 \n",
- " 0.418125 \n",
- " None \n",
- " None \n",
- " RIGHT_FOOT \n",
- " 0 \n",
- " 0 \n",
- " \n",
- " \n",
- " 12 \n",
- " 79851101-0f47-48e2-bdac-2de2b2bc89cb \n",
- " SHOT \n",
- " SAVED \n",
- " False \n",
- " 2 \n",
- " 159.524 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5211 \n",
- " 0.973750 \n",
- " 0.389375 \n",
- " None \n",
- " None \n",
- " LEFT_FOOT \n",
- " 0 \n",
- " 0 \n",
- " \n",
- " \n",
- " 13 \n",
- " d37ddbf4-05b6-4127-8ca6-287a069bd912 \n",
- " SHOT \n",
- " BLOCKED \n",
- " False \n",
- " 2 \n",
- " 367.400 \n",
- " None \n",
- " alive \n",
- " 206 \n",
- " 206 \n",
- " 6626 \n",
- " 0.882917 \n",
- " 0.286875 \n",
- " None \n",
- " None \n",
- " LEFT_FOOT \n",
- " 0 \n",
- " 0 \n",
- " \n",
- " \n",
- " 14 \n",
- " b8f9567a-b33c-4013-91a4-dd5c088dd14a \n",
- " SHOT \n",
- " BLOCKED \n",
- " False \n",
- " 2 \n",
- " 534.355 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5246 \n",
- " 0.925417 \n",
- " 0.300625 \n",
- " None \n",
- " None \n",
- " RIGHT_FOOT \n",
- " 0 \n",
- " 0 \n",
- " \n",
- " \n",
- " 15 \n",
- " 2e2b7445-812c-4162-a5a2-4a99290359ae \n",
- " SHOT \n",
- " BLOCKED \n",
- " False \n",
- " 2 \n",
- " 596.388 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 3501 \n",
- " 0.786250 \n",
- " 0.305625 \n",
- " None \n",
- " None \n",
- " RIGHT_FOOT \n",
- " 0 \n",
- " 0 \n",
- " \n",
- " \n",
- " 16 \n",
- " 480a2132-0c0e-4a0b-95e7-eb994a1542ff \n",
- " SHOT \n",
- " BLOCKED \n",
- " False \n",
- " 2 \n",
- " 634.490 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5211 \n",
- " 0.894583 \n",
- " 0.323125 \n",
- " None \n",
- " None \n",
- " LEFT_FOOT \n",
- " 0 \n",
- " 0 \n",
- " \n",
- " \n",
- " 17 \n",
- " dfb55124-1e6a-475c-a460-3d9bf920bf04 \n",
- " SHOT \n",
- " OFF_TARGET \n",
- " False \n",
- " 2 \n",
- " 740.847 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5503 \n",
- " 0.833750 \n",
- " 0.725625 \n",
- " None \n",
- " None \n",
- " LEFT_FOOT \n",
- " 0 \n",
- " 0 \n",
- " \n",
- " \n",
- " 18 \n",
- " ff334a7e-6ec2-4c71-9957-6d8accaf48df \n",
- " SHOT \n",
- " BLOCKED \n",
- " False \n",
- " 2 \n",
- " 936.156 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 3501 \n",
- " 0.834583 \n",
- " 0.345625 \n",
- " None \n",
- " None \n",
- " RIGHT_FOOT \n",
- " 0 \n",
- " 0 \n",
- " \n",
- " \n",
- " 19 \n",
- " 4c7c4ab1-6b9f-4504-a237-249c2e0c549f \n",
- " SHOT \n",
- " GOAL \n",
- " True \n",
- " 2 \n",
- " 1091.954 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5503 \n",
- " 0.800417 \n",
- " 0.563125 \n",
- " None \n",
- " None \n",
- " LEFT_FOOT \n",
- " 0 \n",
- " 0 \n",
- " \n",
- " \n",
- " 20 \n",
- " 28175830-bbf0-4be9-baef-75c1de731809 \n",
- " SHOT \n",
- " POST \n",
- " False \n",
- " 2 \n",
- " 1243.588 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5503 \n",
- " 0.883750 \n",
- " 0.588125 \n",
- " None \n",
- " None \n",
- " LEFT_FOOT \n",
- " 1 \n",
- " 0 \n",
- " \n",
- " \n",
- " 21 \n",
- " 89cef214-dec8-43c7-8222-3ea8942ae868 \n",
- " SHOT \n",
- " BLOCKED \n",
- " False \n",
- " 2 \n",
- " 1413.375 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5470 \n",
- " 0.738750 \n",
- " 0.534375 \n",
- " None \n",
- " None \n",
- " RIGHT_FOOT \n",
- " 1 \n",
- " 0 \n",
- " \n",
- " \n",
- " 22 \n",
- " 0a78095f-dde1-4cba-8639-3ac2750d3a4d \n",
- " SHOT \n",
- " SAVED \n",
- " False \n",
- " 2 \n",
- " 1647.492 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5246 \n",
- " 0.908750 \n",
- " 0.375625 \n",
- " None \n",
- " None \n",
- " LEFT_FOOT \n",
- " 1 \n",
- " 0 \n",
- " \n",
- " \n",
- " 23 \n",
- " 6e7d482d-30cc-4f5c-9b65-84c52ef8247c \n",
- " SHOT \n",
- " OFF_TARGET \n",
- " False \n",
- " 2 \n",
- " 1997.679 \n",
- " None \n",
- " alive \n",
- " 206 \n",
- " 206 \n",
- " 6935 \n",
- " 0.944583 \n",
- " 0.418125 \n",
- " None \n",
- " None \n",
- " RIGHT_FOOT \n",
- " 1 \n",
- " 0 \n",
- " \n",
- " \n",
- " 24 \n",
- " 5f8f624e-eae9-4e6b-a086-d864bc8f4140 \n",
- " SHOT \n",
- " SAVED \n",
- " False \n",
- " 2 \n",
- " 2191.606 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 3501 \n",
- " 0.944583 \n",
- " 0.388125 \n",
- " None \n",
- " None \n",
- " RIGHT_FOOT \n",
- " 1 \n",
- " 0 \n",
- " \n",
- " \n",
- " 25 \n",
- " 683c6752-13bc-4892-94ed-22e1c938f1f7 \n",
- " SHOT \n",
- " GOAL \n",
- " True \n",
- " 2 \n",
- " 2261.578 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 3501 \n",
- " 0.875417 \n",
- " 0.388125 \n",
- " None \n",
- " None \n",
- " RIGHT_FOOT \n",
- " 1 \n",
- " 0 \n",
- " \n",
- " \n",
- " 26 \n",
- " 252b3061-7d3f-4922-b04f-0b37a44c6300 \n",
- " SHOT \n",
- " SAVED \n",
- " False \n",
- " 2 \n",
- " 2662.638 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5503 \n",
- " 0.883750 \n",
- " 0.575625 \n",
- " None \n",
- " None \n",
- " LEFT_FOOT \n",
- " 2 \n",
- " 0 \n",
- " \n",
- " \n",
- " 27 \n",
- " 55d71847-9511-4417-aea9-6f415e279011 \n",
- " SHOT \n",
- " GOAL \n",
- " True \n",
- " 2 \n",
- " 2802.770 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5503 \n",
- " 0.932917 \n",
- " 0.431875 \n",
- " None \n",
- " None \n",
- " LEFT_FOOT \n",
- " 2 \n",
- " 0 \n",
- " \n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " event_id event_type result success \\\n",
- "0 65f16e50-7c5d-4293-b2fc-d20887a772f9 SHOT OFF_TARGET False \n",
- "1 b0f73423-3990-45ae-9dda-3512c2d1aff3 SHOT OFF_TARGET False \n",
- "2 13b1ddab-d22e-43d9-bfe4-12632fea1a27 SHOT SAVED False \n",
- "3 391bfb74-07a6-4afe-9568-02a9b23f5bd4 SHOT OFF_TARGET False \n",
- "4 5e55f5a5-954f-4cc4-ba6e-a9cf6d6e249e SHOT OFF_TARGET False \n",
- "5 1c0347cd-14dc-4aa8-91eb-520672a6cfe1 SHOT OFF_TARGET False \n",
- "6 7c3182af-c8a8-4c7c-934e-5c41c7b93c6a SHOT OFF_TARGET False \n",
- "7 39f231e5-0072-461c-beb0-a9bedb420f83 SHOT POST False \n",
- "8 062cdd08-8773-424f-8fc5-2e3d441c3c5c SHOT OFF_TARGET False \n",
- "9 c09e904d-6c8e-479d-af2e-c2c5863aca71 SHOT SAVED False \n",
- "10 9eda2385-88bb-4c37-b039-a738c4cd8d4b SHOT OFF_TARGET False \n",
- "11 0b56df83-958e-4a31-9e5a-d741b4bf95cf SHOT OFF_TARGET False \n",
- "12 79851101-0f47-48e2-bdac-2de2b2bc89cb SHOT SAVED False \n",
- "13 d37ddbf4-05b6-4127-8ca6-287a069bd912 SHOT BLOCKED False \n",
- "14 b8f9567a-b33c-4013-91a4-dd5c088dd14a SHOT BLOCKED False \n",
- "15 2e2b7445-812c-4162-a5a2-4a99290359ae SHOT BLOCKED False \n",
- "16 480a2132-0c0e-4a0b-95e7-eb994a1542ff SHOT BLOCKED False \n",
- "17 dfb55124-1e6a-475c-a460-3d9bf920bf04 SHOT OFF_TARGET False \n",
- "18 ff334a7e-6ec2-4c71-9957-6d8accaf48df SHOT BLOCKED False \n",
- "19 4c7c4ab1-6b9f-4504-a237-249c2e0c549f SHOT GOAL True \n",
- "20 28175830-bbf0-4be9-baef-75c1de731809 SHOT POST False \n",
- "21 89cef214-dec8-43c7-8222-3ea8942ae868 SHOT BLOCKED False \n",
- "22 0a78095f-dde1-4cba-8639-3ac2750d3a4d SHOT SAVED False \n",
- "23 6e7d482d-30cc-4f5c-9b65-84c52ef8247c SHOT OFF_TARGET False \n",
- "24 5f8f624e-eae9-4e6b-a086-d864bc8f4140 SHOT SAVED False \n",
- "25 683c6752-13bc-4892-94ed-22e1c938f1f7 SHOT GOAL True \n",
- "26 252b3061-7d3f-4922-b04f-0b37a44c6300 SHOT SAVED False \n",
- "27 55d71847-9511-4417-aea9-6f415e279011 SHOT GOAL True \n",
- "\n",
- " period_id timestamp end_timestamp ball_state ball_owning_team team_id \\\n",
- "0 1 149.094 None alive 217 217 \n",
- "1 1 339.239 None alive 217 217 \n",
- "2 1 928.625 None alive 217 217 \n",
- "3 1 979.616 None alive 206 206 \n",
- "4 1 1095.914 None alive 217 217 \n",
- "5 1 1842.287 None alive 217 217 \n",
- "6 1 2104.861 None alive 217 217 \n",
- "7 1 2248.168 None alive 217 217 \n",
- "8 1 2250.989 None alive 217 217 \n",
- "9 1 2308.083 None alive 217 217 \n",
- "10 1 2434.592 None alive 217 217 \n",
- "11 1 2610.612 None alive 217 217 \n",
- "12 2 159.524 None alive 217 217 \n",
- "13 2 367.400 None alive 206 206 \n",
- "14 2 534.355 None alive 217 217 \n",
- "15 2 596.388 None alive 217 217 \n",
- "16 2 634.490 None alive 217 217 \n",
- "17 2 740.847 None alive 217 217 \n",
- "18 2 936.156 None alive 217 217 \n",
- "19 2 1091.954 None alive 217 217 \n",
- "20 2 1243.588 None alive 217 217 \n",
- "21 2 1413.375 None alive 217 217 \n",
- "22 2 1647.492 None alive 217 217 \n",
- "23 2 1997.679 None alive 206 206 \n",
- "24 2 2191.606 None alive 217 217 \n",
- "25 2 2261.578 None alive 217 217 \n",
- "26 2 2662.638 None alive 217 217 \n",
- "27 2 2802.770 None alive 217 217 \n",
- "\n",
- " player_id coordinates_x coordinates_y end_coordinates_x \\\n",
- "0 5503 0.930417 0.645625 None \n",
- "1 5211 0.949583 0.336875 None \n",
- "2 5503 0.766250 0.430625 None \n",
- "3 6613 0.908750 0.483125 None \n",
- "4 5246 0.891250 0.311875 None \n",
- "5 5477 0.900417 0.341875 None \n",
- "6 5470 0.932917 0.545625 None \n",
- "7 5503 0.807917 0.674375 None \n",
- "8 5213 0.935417 0.516875 None \n",
- "9 5477 0.853750 0.364375 None \n",
- "10 5246 0.910417 0.370625 None \n",
- "11 5477 0.887083 0.418125 None \n",
- "12 5211 0.973750 0.389375 None \n",
- "13 6626 0.882917 0.286875 None \n",
- "14 5246 0.925417 0.300625 None \n",
- "15 3501 0.786250 0.305625 None \n",
- "16 5211 0.894583 0.323125 None \n",
- "17 5503 0.833750 0.725625 None \n",
- "18 3501 0.834583 0.345625 None \n",
- "19 5503 0.800417 0.563125 None \n",
- "20 5503 0.883750 0.588125 None \n",
- "21 5470 0.738750 0.534375 None \n",
- "22 5246 0.908750 0.375625 None \n",
- "23 6935 0.944583 0.418125 None \n",
- "24 3501 0.944583 0.388125 None \n",
- "25 3501 0.875417 0.388125 None \n",
- "26 5503 0.883750 0.575625 None \n",
- "27 5503 0.932917 0.431875 None \n",
- "\n",
- " end_coordinates_y body_part_type home_score away_score \n",
- "0 None RIGHT_FOOT 0 0 \n",
- "1 None LEFT_FOOT 0 0 \n",
- "2 None LEFT_FOOT 0 0 \n",
- "3 None HEAD 0 0 \n",
- "4 None RIGHT_FOOT 0 0 \n",
- "5 None LEFT_FOOT 0 0 \n",
- "6 None HEAD 0 0 \n",
- "7 None LEFT_FOOT 0 0 \n",
- "8 None HEAD 0 0 \n",
- "9 None RIGHT_FOOT 0 0 \n",
- "10 None RIGHT_FOOT 0 0 \n",
- "11 None RIGHT_FOOT 0 0 \n",
- "12 None LEFT_FOOT 0 0 \n",
- "13 None LEFT_FOOT 0 0 \n",
- "14 None RIGHT_FOOT 0 0 \n",
- "15 None RIGHT_FOOT 0 0 \n",
- "16 None LEFT_FOOT 0 0 \n",
- "17 None LEFT_FOOT 0 0 \n",
- "18 None RIGHT_FOOT 0 0 \n",
- "19 None LEFT_FOOT 0 0 \n",
- "20 None LEFT_FOOT 1 0 \n",
- "21 None RIGHT_FOOT 1 0 \n",
- "22 None LEFT_FOOT 1 0 \n",
- "23 None RIGHT_FOOT 1 0 \n",
- "24 None RIGHT_FOOT 1 0 \n",
- "25 None RIGHT_FOOT 1 0 \n",
- "26 None LEFT_FOOT 2 0 \n",
- "27 None LEFT_FOOT 2 0 "
- ]
- },
- "execution_count": 35,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "dataframe = dataset.to_df(\n",
- " \"*\",\n",
- " home_score=lambda event: event.state['score'].home,\n",
- " away_score=lambda event: event.state['score'].away\n",
- ")\n",
- "dataframe"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Now filter the dataframe. We only want to see shots when we are winning by at least two goals difference."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 36,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " event_id \n",
- " event_type \n",
- " result \n",
- " success \n",
- " period_id \n",
- " timestamp \n",
- " end_timestamp \n",
- " ball_state \n",
- " ball_owning_team \n",
- " team_id \n",
- " player_id \n",
- " coordinates_x \n",
- " coordinates_y \n",
- " end_coordinates_x \n",
- " end_coordinates_y \n",
- " body_part_type \n",
- " home_score \n",
- " away_score \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 26 \n",
- " 252b3061-7d3f-4922-b04f-0b37a44c6300 \n",
- " SHOT \n",
- " SAVED \n",
- " False \n",
- " 2 \n",
- " 2662.638 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5503 \n",
- " 0.883750 \n",
- " 0.575625 \n",
- " None \n",
- " None \n",
- " LEFT_FOOT \n",
- " 2 \n",
- " 0 \n",
- " \n",
- " \n",
- " 27 \n",
- " 55d71847-9511-4417-aea9-6f415e279011 \n",
- " SHOT \n",
- " GOAL \n",
- " True \n",
- " 2 \n",
- " 2802.770 \n",
- " None \n",
- " alive \n",
- " 217 \n",
- " 217 \n",
- " 5503 \n",
- " 0.932917 \n",
- " 0.431875 \n",
- " None \n",
- " None \n",
- " LEFT_FOOT \n",
- " 2 \n",
- " 0 \n",
- " \n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " event_id event_type result success \\\n",
- "26 252b3061-7d3f-4922-b04f-0b37a44c6300 SHOT SAVED False \n",
- "27 55d71847-9511-4417-aea9-6f415e279011 SHOT GOAL True \n",
- "\n",
- " period_id timestamp end_timestamp ball_state ball_owning_team team_id \\\n",
- "26 2 2662.638 None alive 217 217 \n",
- "27 2 2802.770 None alive 217 217 \n",
- "\n",
- " player_id coordinates_x coordinates_y end_coordinates_x \\\n",
- "26 5503 0.883750 0.575625 None \n",
- "27 5503 0.932917 0.431875 None \n",
- "\n",
- " end_coordinates_y body_part_type home_score away_score \n",
- "26 None LEFT_FOOT 2 0 \n",
- "27 None LEFT_FOOT 2 0 "
- ]
- },
- "execution_count": 36,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "dataframe[dataframe['home_score'] - dataframe['away_score'] >= 2]"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Add state - lineup\n",
- "\n",
- "We are able to add more state. In this example we'll look at adding lineup state."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 37,
- "metadata": {},
- "outputs": [
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "/Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages/kloppy-3.7.1-py3.10.egg/kloppy/_providers/statsbomb.py:67: UserWarning: \n",
- "\n",
- "You are about to use StatsBomb public data.\n",
- "By using this data, you are agreeing to the user agreement. \n",
- "The user agreement can be found here: https://github.com/statsbomb/open-data/blob/master/LICENSE.pdf\n",
- "\n",
- " warnings.warn(\n"
- ]
- }
- ],
- "source": [
- "from kloppy import statsbomb\n",
- "from kloppy.domain import EventType\n",
- "\n",
- "dataset = statsbomb.load_open_data()\n",
- "\n",
- "home_team, away_team = dataset.metadata.teams"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "Arturo Vidal is a substitute on the side of Barcelona. We add lineup to all events so we are able to filter out events where Arturo Vidal is on the pitch."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 38,
- "metadata": {},
- "outputs": [],
- "source": [
- "arturo_vidal = home_team.get_player_by_id(8206)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 39,
- "metadata": {},
- "outputs": [],
- "source": [
- "dataframe = (\n",
- " dataset\n",
- " .add_state('lineup')\n",
- " .filter(lambda event: arturo_vidal in event.state['lineup'].players)\n",
- " .to_df()\n",
- ")"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 40,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "time on pitch: 490.6479999999997 seconds\n"
- ]
- }
- ],
- "source": [
- "print(f\"time on pitch: {dataframe['timestamp'].max() - dataframe['timestamp'].min()} seconds\")\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 41,
- "metadata": {},
- "outputs": [],
- "source": [
- "dataframe = (\n",
- " dataset\n",
- " .add_state('lineup')\n",
- " .filter(lambda event: event.event_type == EventType.PASS and event.team == home_team)\n",
- " .to_df(\n",
- " \"*\",\n",
- " vidal_on_pitch=lambda event: arturo_vidal in event.state['lineup'].players\n",
- " )\n",
- ")"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 42,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " sum \n",
- " count \n",
- " percentage \n",
- " \n",
- " \n",
- " vidal_on_pitch \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " False \n",
- " 709 \n",
- " 798 \n",
- " 88.847118 \n",
- " \n",
- " \n",
- " True \n",
- " 83 \n",
- " 88 \n",
- " 94.318182 \n",
- " \n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " sum count percentage\n",
- "vidal_on_pitch \n",
- "False 709 798 88.847118\n",
- "True 83 88 94.318182"
- ]
- },
- "execution_count": 42,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "dataframe = dataframe.groupby(['vidal_on_pitch'])['success'].agg(['sum', 'count'])\n",
- "dataframe['percentage'] = dataframe['sum'] / dataframe['count'] * 100\n",
- "dataframe"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Add state - formation\n",
- "\n",
- "In this example we'll look at adding formation state to all shots."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 43,
- "metadata": {},
- "outputs": [
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "/Users/koen/Developer/Projects/PySport/kloppy/.venv/lib/python3.10/site-packages/kloppy-3.7.1-py3.10.egg/kloppy/_providers/statsbomb.py:67: UserWarning: \n",
- "\n",
- "You are about to use StatsBomb public data.\n",
- "By using this data, you are agreeing to the user agreement. \n",
- "The user agreement can be found here: https://github.com/statsbomb/open-data/blob/master/LICENSE.pdf\n",
- "\n",
- " warnings.warn(\n"
- ]
- }
- ],
- "source": [
- "from kloppy import statsbomb\n",
- "from kloppy.domain import EventType\n",
- "\n",
- "\n",
- "dataset = statsbomb.load_open_data()\n",
- "\n",
- "dataframe = (\n",
- " dataset\n",
- " .add_state('formation')\n",
- " .filter(\n",
- " lambda event: event.event_type == EventType.SHOT\n",
- " )\n",
- " .to_df(\n",
- " \"*\",\n",
- " Team=lambda event: str(event.team),\n",
- " Formation=lambda event: str(\n",
- " event.state['formation'].home \n",
- " if event.team == dataset.metadata.teams[0] \n",
- " else event.state['formation'].away\n",
- " )\n",
- " )\n",
- ")"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 44,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " \n",
- " Goals \n",
- " Shots \n",
- " Percentage \n",
- " \n",
- " \n",
- " Team \n",
- " Formation \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " Barcelona \n",
- " 4-3-3 \n",
- " 3 \n",
- " 14 \n",
- " 21.428571 \n",
- " \n",
- " \n",
- " 4-4-2 \n",
- " 0 \n",
- " 11 \n",
- " 0.000000 \n",
- " \n",
- " \n",
- " Deportivo Alavés \n",
- " 4-1-4-1 \n",
- " 0 \n",
- " 2 \n",
- " 0.000000 \n",
- " \n",
- " \n",
- " 4-4-2 \n",
- " 0 \n",
- " 1 \n",
- " 0.000000 \n",
- " \n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " Goals Shots Percentage\n",
- "Team Formation \n",
- "Barcelona 4-3-3 3 14 21.428571\n",
- " 4-4-2 0 11 0.000000\n",
- "Deportivo Alavés 4-1-4-1 0 2 0.000000\n",
- " 4-4-2 0 1 0.000000"
- ]
- },
- "execution_count": 44,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "dataframe_stats = (\n",
- " dataframe\n",
- " .groupby(['Team', 'Formation'])['success']\n",
- " .agg(['sum', 'count'])\n",
- ")\n",
- "dataframe_stats['Percentage'] = (\n",
- " dataframe_stats['sum'] \n",
- " / dataframe_stats['count'] \n",
- " * 100\n",
- ")\n",
- "dataframe_stats.rename(\n",
- " columns={\n",
- " 'sum': 'Goals',\n",
- " 'count': 'Shots'\n",
- " }\n",
- ")"
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "kloppy-venv",
- "language": "python",
- "name": "kloppy-venv"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.10.6"
- },
- "toc": {
- "base_numbering": 1,
- "nav_menu": {},
- "number_sections": true,
- "sideBar": true,
- "skip_h1_title": false,
- "title_cell": "Table of Contents",
- "title_sidebar": "Contents",
- "toc_cell": false,
- "toc_position": {},
- "toc_section_display": true,
- "toc_window_display": false
- }
- },
- "nbformat": 4,
- "nbformat_minor": 4
-}
diff --git a/docs/examples/tracking_data.ipynb b/docs/examples/tracking_data.ipynb
deleted file mode 100644
index 2b613be3..00000000
--- a/docs/examples/tracking_data.ipynb
+++ /dev/null
@@ -1,3373 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "# Tracking data\n",
- "\n",
- "Metadata is available on tracking data. TRACAB and Metrica does not include any extra metadata besides team and jersey number. [EPTS](https://football-technology.fifa.com/en/media-tiles/research-development-epts-standard-data-format/) is the only format right now that contains additional information that will be loaded as metadata\n",
- "\n",
- "\n",
- "## Loading Metrica data\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 2,
- "metadata": {
- "scrolled": true
- },
- "outputs": [],
- "source": [
- "from kloppy import metrica\n",
- "\n",
- "dataset = metrica.load_open_data(limit=10)\n"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Exploring the data\n",
- "\n",
- "When you want to show the name of a player you are advised to use `str(player)`. This will call the magic `__str__` method that handles fallbacks for missing data. By default it will return `full_name`, and fallback to 1) `first_name last_name` 2) `player_id`."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 2,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "['home_11 (11)',\n",
- " 'home_1 (1)',\n",
- " 'home_2 (2)',\n",
- " 'home_3 (3)',\n",
- " 'home_4 (4)',\n",
- " 'home_5 (5)',\n",
- " 'home_6 (6)',\n",
- " 'home_7 (7)',\n",
- " 'home_8 (8)',\n",
- " 'home_9 (9)',\n",
- " 'home_10 (10)',\n",
- " 'home_12 (12)',\n",
- " 'home_13 (13)',\n",
- " 'home_14 (14)']"
- ]
- },
- "execution_count": 2,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "metadata = dataset.metadata\n",
- "home_team, away_team = metadata.teams\n",
- "\n",
- "[f\"{player} ({player.jersey_no})\" for player in home_team.players]\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 3,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "home - Home\n",
- "away - Away\n"
- ]
- }
- ],
- "source": [
- "print(f\"{home_team.ground} - {home_team}\")\n",
- "print(f\"{away_team.ground} - {away_team}\")"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {
- "collapsed": true
- },
- "source": [
- "## Working with tracking data\n",
- "\n",
- "The actual tracking data is available at `dataset.frames`. This list holds all frames. Each frame has a `players_coordinates` dictionary that is indexed by `Player` entities and has values of the `Point` type.\n",
- "\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 4,
- "metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Number of players in the frame: 22\n",
- "List home team players coordinates\n",
- "[Point(x=0.00082, y=0.51762),\n",
- " Point(x=0.32648, y=0.34678),\n",
- " Point(x=0.33701, y=0.51137),\n",
- " Point(x=0.30927, y=0.64471),\n",
- " Point(x=0.32137, y=0.78738),\n",
- " Point(x=0.41094, y=0.27410999999999996),\n",
- " Point(x=0.41698, y=0.52157),\n",
- " Point(x=0.39125, y=0.6745),\n",
- " Point(x=0.45388, y=0.78826),\n",
- " Point(x=0.52697, y=0.6202),\n",
- " Point(x=0.55243, y=0.56731)]\n"
- ]
- }
- ],
- "source": [
- "first_frame = dataset.frames[0]\n",
- "print(f\"Number of players in the frame: {len(first_frame.players_coordinates)}\")\n",
- "\n",
- "from pprint import pprint\n",
- "print(\"List home team players coordinates\")\n",
- "pprint([\n",
- " player_coordinates \n",
- " for player, player_coordinates\n",
- " in first_frame.players_coordinates.items()\n",
- " if player.team == home_team\n",
- "])"
- ]
- },
- {
- "cell_type": "markdown",
- "metadata": {},
- "source": [
- "## Exporting to a dataframe\n",
- "\n",
- "kloppy allows you to export a `dataset` to a `DataFrame`. Both polars and pandas are supported. You can use the following engines: `polars`, `pandas`, `pandas[pyarrow]`. The pyarrow engine requires python 3.8 or higher."
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 13,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "period_id int64\n",
- "timestamp float64\n",
- "frame_id int64\n",
- "ball_state object\n",
- "ball_owning_team_id object\n",
- " ... \n",
- "away_23_s object\n",
- "away_24_x float64\n",
- "away_24_y float64\n",
- "away_24_d object\n",
- "away_24_s object\n",
- "Length: 96, dtype: object"
- ]
- },
- "execution_count": 13,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "df = dataset.to_df(engine=\"pandas\") # default behaviour\n",
- "df.dtypes"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 14,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "period_id int64[pyarrow]\n",
- "timestamp double[pyarrow]\n",
- "frame_id int64[pyarrow]\n",
- "ball_state null[pyarrow]\n",
- "ball_owning_team_id null[pyarrow]\n",
- " ... \n",
- "away_23_s null[pyarrow]\n",
- "away_24_x double[pyarrow]\n",
- "away_24_y double[pyarrow]\n",
- "away_24_d null[pyarrow]\n",
- "away_24_s null[pyarrow]\n",
- "Length: 96, dtype: object"
- ]
- },
- "execution_count": 14,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "df = dataset.to_df(engine=\"pandas[pyarrow]\")\n",
- "df.dtypes"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 15,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " period_id \n",
- " timestamp \n",
- " frame_id \n",
- " ball_state \n",
- " ball_owning_team_id \n",
- " ball_x \n",
- " ball_y \n",
- " ball_z \n",
- " home_11_x \n",
- " home_11_y \n",
- " ... \n",
- " away_22_d \n",
- " away_22_s \n",
- " away_23_x \n",
- " away_23_y \n",
- " away_23_d \n",
- " away_23_s \n",
- " away_24_x \n",
- " away_24_y \n",
- " away_24_d \n",
- " away_24_s \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " 1 \n",
- " 0.00 \n",
- " 1 \n",
- " <NA> \n",
- " <NA> \n",
- " 0.45472 \n",
- " 0.61291 \n",
- " <NA> \n",
- " 0.00082 \n",
- " 0.51762 \n",
- " ... \n",
- " <NA> \n",
- " <NA> \n",
- " 0.43693 \n",
- " 0.94998 \n",
- " <NA> \n",
- " <NA> \n",
- " 0.37833 \n",
- " 0.72617 \n",
- " <NA> \n",
- " <NA> \n",
- " \n",
- " \n",
- " 1 \n",
- " 1 \n",
- " 0.04 \n",
- " 2 \n",
- " <NA> \n",
- " <NA> \n",
- " 0.49645 \n",
- " 0.59344 \n",
- " <NA> \n",
- " 0.00096 \n",
- " 0.51762 \n",
- " ... \n",
- " <NA> \n",
- " <NA> \n",
- " 0.43693 \n",
- " 0.94998 \n",
- " <NA> \n",
- " <NA> \n",
- " 0.37833 \n",
- " 0.72617 \n",
- " <NA> \n",
- " <NA> \n",
- " \n",
- " \n",
- " 2 \n",
- " 1 \n",
- " 0.08 \n",
- " 3 \n",
- " <NA> \n",
- " <NA> \n",
- " 0.53716 \n",
- " 0.57444 \n",
- " <NA> \n",
- " 0.00114 \n",
- " 0.51762 \n",
- " ... \n",
- " <NA> \n",
- " <NA> \n",
- " 0.43693 \n",
- " 0.94998 \n",
- " <NA> \n",
- " <NA> \n",
- " 0.37833 \n",
- " 0.72617 \n",
- " <NA> \n",
- " <NA> \n",
- " \n",
- " \n",
- " 3 \n",
- " 1 \n",
- " 0.12 \n",
- " 4 \n",
- " <NA> \n",
- " <NA> \n",
- " 0.55346 \n",
- " 0.57769 \n",
- " <NA> \n",
- " 0.00121 \n",
- " 0.51762 \n",
- " ... \n",
- " <NA> \n",
- " <NA> \n",
- " 0.43644 \n",
- " 0.94962 \n",
- " <NA> \n",
- " <NA> \n",
- " 0.37756 \n",
- " 0.72527 \n",
- " <NA> \n",
- " <NA> \n",
- " \n",
- " \n",
- " 4 \n",
- " 1 \n",
- " 0.16 \n",
- " 5 \n",
- " <NA> \n",
- " <NA> \n",
- " 0.55512 \n",
- " 0.59430 \n",
- " <NA> \n",
- " 0.00129 \n",
- " 0.51762 \n",
- " ... \n",
- " <NA> \n",
- " <NA> \n",
- " 0.43580 \n",
- " 0.95023 \n",
- " <NA> \n",
- " <NA> \n",
- " 0.37663 \n",
- " 0.72457 \n",
- " <NA> \n",
- " <NA> \n",
- " \n",
- " \n",
- " 5 \n",
- " 1 \n",
- " 0.20 \n",
- " 6 \n",
- " <NA> \n",
- " <NA> \n",
- " 0.55677 \n",
- " 0.61091 \n",
- " <NA> \n",
- " 0.00140 \n",
- " 0.51762 \n",
- " ... \n",
- " <NA> \n",
- " <NA> \n",
- " 0.43504 \n",
- " 0.95116 \n",
- " <NA> \n",
- " <NA> \n",
- " 0.37557 \n",
- " 0.72327 \n",
- " <NA> \n",
- " <NA> \n",
- " \n",
- " \n",
- " 6 \n",
- " 1 \n",
- " 0.24 \n",
- " 7 \n",
- " <NA> \n",
- " <NA> \n",
- " 0.55842 \n",
- " 0.62752 \n",
- " <NA> \n",
- " 0.00140 \n",
- " 0.51762 \n",
- " ... \n",
- " <NA> \n",
- " <NA> \n",
- " 0.43423 \n",
- " 0.95195 \n",
- " <NA> \n",
- " <NA> \n",
- " 0.37439 \n",
- " 0.72249 \n",
- " <NA> \n",
- " <NA> \n",
- " \n",
- " \n",
- " 7 \n",
- " 1 \n",
- " 0.28 \n",
- " 8 \n",
- " <NA> \n",
- " <NA> \n",
- " 0.56004 \n",
- " 0.64371 \n",
- " <NA> \n",
- " 0.00140 \n",
- " 0.51762 \n",
- " ... \n",
- " <NA> \n",
- " <NA> \n",
- " 0.43347 \n",
- " 0.95343 \n",
- " <NA> \n",
- " <NA> \n",
- " 0.37320 \n",
- " 0.72152 \n",
- " <NA> \n",
- " <NA> \n",
- " \n",
- " \n",
- " 8 \n",
- " 1 \n",
- " 0.32 \n",
- " 9 \n",
- " <NA> \n",
- " <NA> \n",
- " 0.56173 \n",
- " 0.66074 \n",
- " <NA> \n",
- " 0.00120 \n",
- " 0.51807 \n",
- " ... \n",
- " <NA> \n",
- " <NA> \n",
- " 0.43273 \n",
- " 0.95422 \n",
- " <NA> \n",
- " <NA> \n",
- " 0.37196 \n",
- " 0.72073 \n",
- " <NA> \n",
- " <NA> \n",
- " \n",
- " \n",
- " 9 \n",
- " 1 \n",
- " 0.36 \n",
- " 10 \n",
- " <NA> \n",
- " <NA> \n",
- " 0.56338 \n",
- " 0.67735 \n",
- " <NA> \n",
- " 0.00100 \n",
- " 0.51853 \n",
- " ... \n",
- " <NA> \n",
- " <NA> \n",
- " 0.43199 \n",
- " 0.95566 \n",
- " <NA> \n",
- " <NA> \n",
- " 0.37068 \n",
- " 0.71990 \n",
- " <NA> \n",
- " <NA> \n",
- " \n",
- " \n",
- "
\n",
- "
10 rows × 96 columns
\n",
- "
"
- ],
- "text/plain": [
- " period_id timestamp frame_id ball_state ball_owning_team_id ball_x \n",
- "0 1 0.00 1 0.45472 \\\n",
- "1 1 0.04 2 0.49645 \n",
- "2 1 0.08 3 0.53716 \n",
- "3 1 0.12 4 0.55346 \n",
- "4 1 0.16 5 0.55512 \n",
- "5 1 0.20 6 0.55677 \n",
- "6 1 0.24 7 0.55842 \n",
- "7 1 0.28 8 0.56004 \n",
- "8 1 0.32 9 0.56173 \n",
- "9 1 0.36 10 0.56338 \n",
- "\n",
- " ball_y ball_z home_11_x home_11_y ... away_22_d away_22_s away_23_x \n",
- "0 0.61291 0.00082 0.51762 ... 0.43693 \\\n",
- "1 0.59344 0.00096 0.51762 ... 0.43693 \n",
- "2 0.57444 0.00114 0.51762 ... 0.43693 \n",
- "3 0.57769 0.00121 0.51762 ... 0.43644 \n",
- "4 0.59430 0.00129 0.51762 ... 0.43580 \n",
- "5 0.61091 0.00140 0.51762 ... 0.43504 \n",
- "6 0.62752 0.00140 0.51762 ... 0.43423 \n",
- "7 0.64371 0.00140 0.51762 ... 0.43347 \n",
- "8 0.66074 0.00120 0.51807 ... 0.43273 \n",
- "9 0.67735 0.00100 0.51853 ... 0.43199 \n",
- "\n",
- " away_23_y away_23_d away_23_s away_24_x away_24_y away_24_d away_24_s \n",
- "0 0.94998 0.37833 0.72617 \n",
- "1 0.94998 0.37833 0.72617 \n",
- "2 0.94998 0.37833 0.72617 \n",
- "3 0.94962 0.37756 0.72527 \n",
- "4 0.95023 0.37663 0.72457 \n",
- "5 0.95116 0.37557 0.72327 \n",
- "6 0.95195 0.37439 0.72249 \n",
- "7 0.95343 0.37320 0.72152 \n",
- "8 0.95422 0.37196 0.72073 \n",
- "9 0.95566 0.37068 0.71990 \n",
- "\n",
- "[10 rows x 96 columns]"
- ]
- },
- "execution_count": 15,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "df"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 16,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "\n",
- "
\n",
- "shape: (10, 96) \n",
- "\n",
- "\n",
- "\n",
- "period_id\n",
- " \n",
- "\n",
- "timestamp\n",
- " \n",
- "\n",
- "frame_id\n",
- " \n",
- "\n",
- "ball_state\n",
- " \n",
- "\n",
- "ball_owning_team_id\n",
- " \n",
- "\n",
- "ball_x\n",
- " \n",
- "\n",
- "ball_y\n",
- " \n",
- "\n",
- "ball_z\n",
- " \n",
- "\n",
- "home_11_x\n",
- " \n",
- "\n",
- "home_11_y\n",
- " \n",
- "\n",
- "home_11_d\n",
- " \n",
- "\n",
- "home_11_s\n",
- " \n",
- "\n",
- "home_1_x\n",
- " \n",
- "\n",
- "home_1_y\n",
- " \n",
- "\n",
- "home_1_d\n",
- " \n",
- "\n",
- "home_1_s\n",
- " \n",
- "\n",
- "home_2_x\n",
- " \n",
- "\n",
- "home_2_y\n",
- " \n",
- "\n",
- "home_2_d\n",
- " \n",
- "\n",
- "home_2_s\n",
- " \n",
- "\n",
- "home_3_x\n",
- " \n",
- "\n",
- "home_3_y\n",
- " \n",
- "\n",
- "home_3_d\n",
- " \n",
- "\n",
- "home_3_s\n",
- " \n",
- "\n",
- "home_4_x\n",
- " \n",
- "\n",
- "home_4_y\n",
- " \n",
- "\n",
- "home_4_d\n",
- " \n",
- "\n",
- "home_4_s\n",
- " \n",
- "\n",
- "home_5_x\n",
- " \n",
- "\n",
- "home_5_y\n",
- " \n",
- "\n",
- "home_5_d\n",
- " \n",
- "\n",
- "home_5_s\n",
- " \n",
- "\n",
- "home_6_x\n",
- " \n",
- "\n",
- "home_6_y\n",
- " \n",
- "\n",
- "home_6_d\n",
- " \n",
- "\n",
- "home_6_s\n",
- " \n",
- "\n",
- "home_7_x\n",
- " \n",
- "\n",
- "...\n",
- " \n",
- "\n",
- "away_15_s\n",
- " \n",
- "\n",
- "away_16_x\n",
- " \n",
- "\n",
- "away_16_y\n",
- " \n",
- "\n",
- "away_16_d\n",
- " \n",
- "\n",
- "away_16_s\n",
- " \n",
- "\n",
- "away_17_x\n",
- " \n",
- "\n",
- "away_17_y\n",
- " \n",
- "\n",
- "away_17_d\n",
- " \n",
- "\n",
- "away_17_s\n",
- " \n",
- "\n",
- "away_18_x\n",
- " \n",
- "\n",
- "away_18_y\n",
- " \n",
- "\n",
- "away_18_d\n",
- " \n",
- "\n",
- "away_18_s\n",
- " \n",
- "\n",
- "away_19_x\n",
- " \n",
- "\n",
- "away_19_y\n",
- " \n",
- "\n",
- "away_19_d\n",
- " \n",
- "\n",
- "away_19_s\n",
- " \n",
- "\n",
- "away_20_x\n",
- " \n",
- "\n",
- "away_20_y\n",
- " \n",
- "\n",
- "away_20_d\n",
- " \n",
- "\n",
- "away_20_s\n",
- " \n",
- "\n",
- "away_21_x\n",
- " \n",
- "\n",
- "away_21_y\n",
- " \n",
- "\n",
- "away_21_d\n",
- " \n",
- "\n",
- "away_21_s\n",
- " \n",
- "\n",
- "away_22_x\n",
- " \n",
- "\n",
- "away_22_y\n",
- " \n",
- "\n",
- "away_22_d\n",
- " \n",
- "\n",
- "away_22_s\n",
- " \n",
- "\n",
- "away_23_x\n",
- " \n",
- "\n",
- "away_23_y\n",
- " \n",
- "\n",
- "away_23_d\n",
- " \n",
- "\n",
- "away_23_s\n",
- " \n",
- "\n",
- "away_24_x\n",
- " \n",
- "\n",
- "away_24_y\n",
- " \n",
- "\n",
- "away_24_d\n",
- " \n",
- "\n",
- "away_24_s\n",
- " \n",
- " \n",
- "\n",
- "\n",
- "i64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "i64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "...\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- "\n",
- "f64\n",
- " \n",
- " \n",
- " \n",
- "\n",
- "\n",
- "\n",
- "1\n",
- " \n",
- "\n",
- "0.0\n",
- " \n",
- "\n",
- "1\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.45472\n",
- " \n",
- "\n",
- "0.61291\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.00082\n",
- " \n",
- "\n",
- "0.51762\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.32648\n",
- " \n",
- "\n",
- "0.34678\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.33701\n",
- " \n",
- "\n",
- "0.51137\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.30927\n",
- " \n",
- "\n",
- "0.64471\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.32137\n",
- " \n",
- "\n",
- "0.78738\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.41094\n",
- " \n",
- "\n",
- "0.27411\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.41698\n",
- " \n",
- "\n",
- "0.52157\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.39125\n",
- " \n",
- "\n",
- "...\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.67658\n",
- " \n",
- "\n",
- "0.5329\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.6731\n",
- " \n",
- "\n",
- "0.23524\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.40783\n",
- " \n",
- "\n",
- "0.38475\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.45472\n",
- " \n",
- "\n",
- "0.61291\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.5596\n",
- " \n",
- "\n",
- "0.32225\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.55243\n",
- " \n",
- "\n",
- "0.56731\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.50067\n",
- " \n",
- "\n",
- "0.05678\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.43693\n",
- " \n",
- "\n",
- "0.94998\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.37833\n",
- " \n",
- "\n",
- "0.72617\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- " \n",
- "\n",
- "\n",
- "1\n",
- " \n",
- "\n",
- "0.04\n",
- " \n",
- "\n",
- "2\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.49645\n",
- " \n",
- "\n",
- "0.59344\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.00096\n",
- " \n",
- "\n",
- "0.51762\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.32648\n",
- " \n",
- "\n",
- "0.34678\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.33701\n",
- " \n",
- "\n",
- "0.51137\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.30927\n",
- " \n",
- "\n",
- "0.64471\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.32137\n",
- " \n",
- "\n",
- "0.78738\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.41094\n",
- " \n",
- "\n",
- "0.27411\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.41698\n",
- " \n",
- "\n",
- "0.52157\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.39125\n",
- " \n",
- "\n",
- "...\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.67658\n",
- " \n",
- "\n",
- "0.5329\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.6731\n",
- " \n",
- "\n",
- "0.23524\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.40783\n",
- " \n",
- "\n",
- "0.38475\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.45472\n",
- " \n",
- "\n",
- "0.61291\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.5596\n",
- " \n",
- "\n",
- "0.32225\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.55243\n",
- " \n",
- "\n",
- "0.56731\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.50067\n",
- " \n",
- "\n",
- "0.05678\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.43693\n",
- " \n",
- "\n",
- "0.94998\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.37833\n",
- " \n",
- "\n",
- "0.72617\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- " \n",
- "\n",
- "\n",
- "1\n",
- " \n",
- "\n",
- "0.08\n",
- " \n",
- "\n",
- "3\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.53716\n",
- " \n",
- "\n",
- "0.57444\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.00114\n",
- " \n",
- "\n",
- "0.51762\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.32648\n",
- " \n",
- "\n",
- "0.34678\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.33701\n",
- " \n",
- "\n",
- "0.51137\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.30927\n",
- " \n",
- "\n",
- "0.64471\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.32137\n",
- " \n",
- "\n",
- "0.78738\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.41094\n",
- " \n",
- "\n",
- "0.27411\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.41698\n",
- " \n",
- "\n",
- "0.52157\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.39125\n",
- " \n",
- "\n",
- "...\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.67658\n",
- " \n",
- "\n",
- "0.5329\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.6731\n",
- " \n",
- "\n",
- "0.23524\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.40783\n",
- " \n",
- "\n",
- "0.38475\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.45472\n",
- " \n",
- "\n",
- "0.61291\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.5596\n",
- " \n",
- "\n",
- "0.32225\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.55243\n",
- " \n",
- "\n",
- "0.56731\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.50067\n",
- " \n",
- "\n",
- "0.05678\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.43693\n",
- " \n",
- "\n",
- "0.94998\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.37833\n",
- " \n",
- "\n",
- "0.72617\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- " \n",
- "\n",
- "\n",
- "1\n",
- " \n",
- "\n",
- "0.12\n",
- " \n",
- "\n",
- "4\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.55346\n",
- " \n",
- "\n",
- "0.57769\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.00121\n",
- " \n",
- "\n",
- "0.51762\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.32622\n",
- " \n",
- "\n",
- "0.34683\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.33687\n",
- " \n",
- "\n",
- "0.51012\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.30944\n",
- " \n",
- "\n",
- "0.64446\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.32142\n",
- " \n",
- "\n",
- "0.78759\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.41067\n",
- " \n",
- "\n",
- "0.27435\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.41703\n",
- " \n",
- "\n",
- "0.52035\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.39134\n",
- " \n",
- "\n",
- "...\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.6764\n",
- " \n",
- "\n",
- "0.53238\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.67279\n",
- " \n",
- "\n",
- "0.23458\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.40771\n",
- " \n",
- "\n",
- "0.38495\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.45454\n",
- " \n",
- "\n",
- "0.61182\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.55974\n",
- " \n",
- "\n",
- "0.32224\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.55236\n",
- " \n",
- "\n",
- "0.56687\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.50034\n",
- " \n",
- "\n",
- "0.05609\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.43644\n",
- " \n",
- "\n",
- "0.94962\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.37756\n",
- " \n",
- "\n",
- "0.72527\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- " \n",
- "\n",
- "\n",
- "1\n",
- " \n",
- "\n",
- "0.16\n",
- " \n",
- "\n",
- "5\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.55512\n",
- " \n",
- "\n",
- "0.5943\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.00129\n",
- " \n",
- "\n",
- "0.51762\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.32597\n",
- " \n",
- "\n",
- "0.34731\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.33664\n",
- " \n",
- "\n",
- "0.50982\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.30948\n",
- " \n",
- "\n",
- "0.64472\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.32136\n",
- " \n",
- "\n",
- "0.78841\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.41065\n",
- " \n",
- "\n",
- "0.2749\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.41682\n",
- " \n",
- "\n",
- "0.52048\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.39141\n",
- " \n",
- "\n",
- "...\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.67599\n",
- " \n",
- "\n",
- "0.53231\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.67253\n",
- " \n",
- "\n",
- "0.23436\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.40736\n",
- " \n",
- "\n",
- "0.38529\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.45426\n",
- " \n",
- "\n",
- "0.61275\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.55992\n",
- " \n",
- "\n",
- "0.32209\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.55202\n",
- " \n",
- "\n",
- "0.56689\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.50017\n",
- " \n",
- "\n",
- "0.05566\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.4358\n",
- " \n",
- "\n",
- "0.95023\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.37663\n",
- " \n",
- "\n",
- "0.72457\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- " \n",
- "\n",
- "\n",
- "1\n",
- " \n",
- "\n",
- "0.2\n",
- " \n",
- "\n",
- "6\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.55677\n",
- " \n",
- "\n",
- "0.61091\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.0014\n",
- " \n",
- "\n",
- "0.51762\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.32581\n",
- " \n",
- "\n",
- "0.34841\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.33637\n",
- " \n",
- "\n",
- "0.51034\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.30978\n",
- " \n",
- "\n",
- "0.64521\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.32159\n",
- " \n",
- "\n",
- "0.78949\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.41082\n",
- " \n",
- "\n",
- "0.27561\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.41663\n",
- " \n",
- "\n",
- "0.5218\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.3919\n",
- " \n",
- "\n",
- "...\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.67537\n",
- " \n",
- "\n",
- "0.53273\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.67194\n",
- " \n",
- "\n",
- "0.23481\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.40697\n",
- " \n",
- "\n",
- "0.38691\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.45397\n",
- " \n",
- "\n",
- "0.61379\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.56017\n",
- " \n",
- "\n",
- "0.32324\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.55157\n",
- " \n",
- "\n",
- "0.56743\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.49989\n",
- " \n",
- "\n",
- "0.05568\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.43504\n",
- " \n",
- "\n",
- "0.95116\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.37557\n",
- " \n",
- "\n",
- "0.72327\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- " \n",
- "\n",
- "\n",
- "1\n",
- " \n",
- "\n",
- "0.24\n",
- " \n",
- "\n",
- "7\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.55842\n",
- " \n",
- "\n",
- "0.62752\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.0014\n",
- " \n",
- "\n",
- "0.51762\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.3257\n",
- " \n",
- "\n",
- "0.34963\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.33624\n",
- " \n",
- "\n",
- "0.51081\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.31015\n",
- " \n",
- "\n",
- "0.64561\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.32198\n",
- " \n",
- "\n",
- "0.79079\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.41094\n",
- " \n",
- "\n",
- "0.27703\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.41641\n",
- " \n",
- "\n",
- "0.52318\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.39235\n",
- " \n",
- "\n",
- "...\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.67471\n",
- " \n",
- "\n",
- "0.53342\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.67133\n",
- " \n",
- "\n",
- "0.23545\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.40653\n",
- " \n",
- "\n",
- "0.38889\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.45365\n",
- " \n",
- "\n",
- "0.61524\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.56049\n",
- " \n",
- "\n",
- "0.32509\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.55095\n",
- " \n",
- "\n",
- "0.568\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.49952\n",
- " \n",
- "\n",
- "0.05609\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.43423\n",
- " \n",
- "\n",
- "0.95195\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.37439\n",
- " \n",
- "\n",
- "0.72249\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- " \n",
- "\n",
- "\n",
- "1\n",
- " \n",
- "\n",
- "0.28\n",
- " \n",
- "\n",
- "8\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.56004\n",
- " \n",
- "\n",
- "0.64371\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.0014\n",
- " \n",
- "\n",
- "0.51762\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.32564\n",
- " \n",
- "\n",
- "0.35084\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.33608\n",
- " \n",
- "\n",
- "0.51131\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.3105\n",
- " \n",
- "\n",
- "0.64627\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.32243\n",
- " \n",
- "\n",
- "0.79227\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.411\n",
- " \n",
- "\n",
- "0.27849\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.41618\n",
- " \n",
- "\n",
- "0.52467\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.39281\n",
- " \n",
- "\n",
- "...\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.67406\n",
- " \n",
- "\n",
- "0.5345\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.67063\n",
- " \n",
- "\n",
- "0.23644\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.4061\n",
- " \n",
- "\n",
- "0.39067\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.45323\n",
- " \n",
- "\n",
- "0.61675\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.56084\n",
- " \n",
- "\n",
- "0.32694\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.55034\n",
- " \n",
- "\n",
- "0.56908\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.4992\n",
- " \n",
- "\n",
- "0.05658\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.43347\n",
- " \n",
- "\n",
- "0.95343\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.3732\n",
- " \n",
- "\n",
- "0.72152\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- " \n",
- "\n",
- "\n",
- "1\n",
- " \n",
- "\n",
- "0.32\n",
- " \n",
- "\n",
- "9\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.56173\n",
- " \n",
- "\n",
- "0.66074\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.0012\n",
- " \n",
- "\n",
- "0.51807\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.32557\n",
- " \n",
- "\n",
- "0.35222\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.33593\n",
- " \n",
- "\n",
- "0.5119\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.31089\n",
- " \n",
- "\n",
- "0.64675\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.32282\n",
- " \n",
- "\n",
- "0.79394\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.41109\n",
- " \n",
- "\n",
- "0.28002\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.41592\n",
- " \n",
- "\n",
- "0.52596\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.39319\n",
- " \n",
- "\n",
- "...\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.67335\n",
- " \n",
- "\n",
- "0.53554\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.66985\n",
- " \n",
- "\n",
- "0.23731\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.40562\n",
- " \n",
- "\n",
- "0.39252\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.4528\n",
- " \n",
- "\n",
- "0.61873\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.56123\n",
- " \n",
- "\n",
- "0.32896\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.54961\n",
- " \n",
- "\n",
- "0.56997\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.49885\n",
- " \n",
- "\n",
- "0.05704\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.43273\n",
- " \n",
- "\n",
- "0.95422\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.37196\n",
- " \n",
- "\n",
- "0.72073\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- " \n",
- "\n",
- "\n",
- "1\n",
- " \n",
- "\n",
- "0.36\n",
- " \n",
- "\n",
- "10\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.56338\n",
- " \n",
- "\n",
- "0.67735\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.001\n",
- " \n",
- "\n",
- "0.51853\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.32551\n",
- " \n",
- "\n",
- "0.35363\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.33581\n",
- " \n",
- "\n",
- "0.51244\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.31133\n",
- " \n",
- "\n",
- "0.64735\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.32312\n",
- " \n",
- "\n",
- "0.79555\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.41119\n",
- " \n",
- "\n",
- "0.28163\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.41563\n",
- " \n",
- "\n",
- "0.5276\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.39362\n",
- " \n",
- "\n",
- "...\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.67265\n",
- " \n",
- "\n",
- "0.53646\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.66911\n",
- " \n",
- "\n",
- "0.23839\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.40513\n",
- " \n",
- "\n",
- "0.39424\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.45237\n",
- " \n",
- "\n",
- "0.62088\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.56163\n",
- " \n",
- "\n",
- "0.33123\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.5488\n",
- " \n",
- "\n",
- "0.5711\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.49848\n",
- " \n",
- "\n",
- "0.05756\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.43199\n",
- " \n",
- "\n",
- "0.95566\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "0.37068\n",
- " \n",
- "\n",
- "0.7199\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- "\n",
- "null\n",
- " \n",
- " \n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- "shape: (10, 96)\n",
- "┌─────────┬────────────┬──────────┬──────────┬─────┬───────────┬───────────┬───────────┬───────────┐\n",
- "│ period_ ┆ timestamp ┆ frame_id ┆ ball_sta ┆ ... ┆ away_24_x ┆ away_24_y ┆ away_24_d ┆ away_24_s │\n",
- "│ id ┆ --- ┆ --- ┆ te ┆ ┆ --- ┆ --- ┆ --- ┆ --- │\n",
- "│ --- ┆ f64 ┆ i64 ┆ --- ┆ ┆ f64 ┆ f64 ┆ f64 ┆ f64 │\n",
- "│ i64 ┆ ┆ ┆ f64 ┆ ┆ ┆ ┆ ┆ │\n",
- "╞═════════╪════════════╪══════════╪══════════╪═════╪═══════════╪═══════════╪═══════════╪═══════════╡\n",
- "│ 1 ┆ 0.0 ┆ 1 ┆ null ┆ ... ┆ 0.37833 ┆ 0.72617 ┆ null ┆ null │\n",
- "│ 1 ┆ 0.04 ┆ 2 ┆ null ┆ ... ┆ 0.37833 ┆ 0.72617 ┆ null ┆ null │\n",
- "│ 1 ┆ 0.08 ┆ 3 ┆ null ┆ ... ┆ 0.37833 ┆ 0.72617 ┆ null ┆ null │\n",
- "│ 1 ┆ 0.12 ┆ 4 ┆ null ┆ ... ┆ 0.37756 ┆ 0.72527 ┆ null ┆ null │\n",
- "│ ... ┆ ... ┆ ... ┆ ... ┆ ... ┆ ... ┆ ... ┆ ... ┆ ... │\n",
- "│ 1 ┆ 0.24 ┆ 7 ┆ null ┆ ... ┆ 0.37439 ┆ 0.72249 ┆ null ┆ null │\n",
- "│ 1 ┆ 0.28 ┆ 8 ┆ null ┆ ... ┆ 0.3732 ┆ 0.72152 ┆ null ┆ null │\n",
- "│ 1 ┆ 0.32 ┆ 9 ┆ null ┆ ... ┆ 0.37196 ┆ 0.72073 ┆ null ┆ null │\n",
- "│ 1 ┆ 0.36 ┆ 10 ┆ null ┆ ... ┆ 0.37068 ┆ 0.7199 ┆ null ┆ null │\n",
- "└─────────┴────────────┴──────────┴──────────┴─────┴───────────┴───────────┴───────────┴───────────┘"
- ]
- },
- "execution_count": 16,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "df = dataset.to_df(engine=\"polars\")\n",
- "df"
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "Python 3 (ipykernel)",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.10.6"
- },
- "toc": {
- "base_numbering": 1,
- "nav_menu": {},
- "number_sections": true,
- "sideBar": true,
- "skip_h1_title": false,
- "title_cell": "Table of Contents",
- "title_sidebar": "Contents",
- "toc_cell": false,
- "toc_position": {},
- "toc_section_display": true,
- "toc_window_display": false
- }
- },
- "nbformat": 4,
- "nbformat_minor": 4
-}
diff --git a/docs/providers/index.md b/docs/providers/index.md
deleted file mode 100644
index 60486550..00000000
--- a/docs/providers/index.md
+++ /dev/null
@@ -1,33 +0,0 @@
-# Supported providers
-
-## Event data providers
-
-kloppy tries to support as many as possible features for each provider. The table below show what kloppy supports per provider. Each provider might or might not include more information in their files.
-
-Please [open a ticket](https://github.com/PySport/kloppy/issues) when you like to implement additional features.
-
-||| Datafactory | Metrica | Opta | Sportec | Statsbomb | Wyscout |
-|-|-|:-:|:-:|:-:|:-:|:-:|:-:|
-|**File format**||JSON|JSON|XML|XML|JSON|JSON|
-|**Event types**|
-||[Pass][kloppy.domain.models.event.PassEvent]|✓|✓|✓|✓|✓|✓|
-||[Shot][kloppy.domain.models.event.ShotEvent]|✓|✓|✓|✓|✓|✓|
-||[TakeOn][kloppy.domain.models.event.TakeOnEvent]||✓|✓||✓|✓|✓|
-||[Carry][kloppy.domain.models.event.CarryEvent]||✓|||✓||
-||[Substitution][kloppy.domain.models.event.SubstitutionEvent]|✓|||✓|✓||
-||[PlayerOn][kloppy.domain.models.event.PlayerOnEvent]/[Off][kloppy.domain.models.event.PlayerOffEvent]|||||✓||
-||[Card][kloppy.domain.models.event.CardEvent]|✓|||✓|✓|✓|
-||[Recovery][kloppy.domain.models.event.RecoveryEvent]|✓|✓|✓|✓|✓|✓|
-||[BallOut][kloppy.domain.models.event.BallOutEvent]|✓[^2]|✓|✓|✓[^2]|✓|✓|
-||[FoulCommitted][kloppy.domain.models.event.FoulCommittedEvent]|✓|✓|✓|✓|✓|✓|
-||[Generic][kloppy.domain.models.event.GenericEvent][^1]|✓|✓|✓|✓|✓|✓|s
-|**Qualifiers**|
-||SetPiece|✓[^3]|✓[^3]|✓[^3]|✓[^3]|✓[^3]|✓[^3]
-||BodyPart||`Head`|`Head` `RightFoot` `LeftFoot` `Other`|`Head` `RightFoot` `LeftFoot`|`Chest` `Head` `RightFoot` `LeftFoot` `Other` [^4]|`RightFoot` `LeftFoot`
-||PassType|||`Cross` `LongBall` `ThroughBall` `Launch` `ChippedBall` `Assist` `2nd Assist` `SwitchOfPlay` |||`Cross` `Hand` `Head` `High` `Launch` `Simple` `Smart`
-
-[^1]: All other event types
-[^2]: Synthetic event generated by kloppy
-[^3]: Full support means support for these types: `Corner` `FreeKick` `Penalty` `ThrowIn` `KickOff` `GoalKick`
-[^4]: All body parts can be found here: https://github.com/statsbomb/open-data/blob/master/doc/StatsBomb%20Open%20Data%20Specification%20v1.1.pdf
-
diff --git a/docs/providers/opta.ipynb b/docs/providers/opta.ipynb
deleted file mode 100644
index ef0f3441..00000000
--- a/docs/providers/opta.ipynb
+++ /dev/null
@@ -1,248 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "markdown",
- "id": "f3c03ff0",
- "metadata": {},
- "source": [
- "# Opta\n",
- "\n",
- "## Load local files\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 1,
- "id": "00366986",
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " event_id \n",
- " event_type \n",
- " result \n",
- " success \n",
- " period_id \n",
- " timestamp \n",
- " end_timestamp \n",
- " ball_state \n",
- " ball_owning_team \n",
- " team_id \n",
- " player_id \n",
- " coordinates_x \n",
- " coordinates_y \n",
- " end_coordinates_x \n",
- " end_coordinates_y \n",
- " receiver_player_id \n",
- " set_piece_type \n",
- " pass_type \n",
- " body_part_type \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " 1510681159 \n",
- " PASS \n",
- " COMPLETE \n",
- " True \n",
- " 1 \n",
- " 0.782 \n",
- " None \n",
- " alive \n",
- " 569 \n",
- " 569 \n",
- " 48337 \n",
- " 50.1 \n",
- " 49.4 \n",
- " 36.4 \n",
- " 45.1 \n",
- " NaN \n",
- " KICK_OFF \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- " 1 \n",
- " 1646695660 \n",
- " PASS \n",
- " COMPLETE \n",
- " True \n",
- " 1 \n",
- " 3.692 \n",
- " None \n",
- " alive \n",
- " 569 \n",
- " 569 \n",
- " 76001 \n",
- " 36.4 \n",
- " 45.1 \n",
- " 28.0 \n",
- " 39.8 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- " 2 \n",
- " 1782829017 \n",
- " PASS \n",
- " COMPLETE \n",
- " True \n",
- " 1 \n",
- " 5.299 \n",
- " None \n",
- " alive \n",
- " 569 \n",
- " 569 \n",
- " 164266 \n",
- " 27.9 \n",
- " 39.8 \n",
- " 29.1 \n",
- " 62.0 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- " 3 \n",
- " 1909884550 \n",
- " PASS \n",
- " COMPLETE \n",
- " True \n",
- " 1 \n",
- " 6.995 \n",
- " None \n",
- " alive \n",
- " 569 \n",
- " 569 \n",
- " 77384 \n",
- " 29.3 \n",
- " 62.6 \n",
- " 26.3 \n",
- " 37.6 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- " 4 \n",
- " 1515097980 \n",
- " PASS \n",
- " COMPLETE \n",
- " True \n",
- " 1 \n",
- " 8.971 \n",
- " None \n",
- " alive \n",
- " 569 \n",
- " 569 \n",
- " 164266 \n",
- " 26.3 \n",
- " 34.3 \n",
- " 29.1 \n",
- " 7.4 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- "
\n",
- "
"
- ],
- "text/plain": [
- " event_id event_type result success period_id timestamp \\\n",
- "0 1510681159 PASS COMPLETE True 1 0.782 \n",
- "1 1646695660 PASS COMPLETE True 1 3.692 \n",
- "2 1782829017 PASS COMPLETE True 1 5.299 \n",
- "3 1909884550 PASS COMPLETE True 1 6.995 \n",
- "4 1515097980 PASS COMPLETE True 1 8.971 \n",
- "\n",
- " end_timestamp ball_state ball_owning_team team_id player_id coordinates_x \\\n",
- "0 None alive 569 569 48337 50.1 \n",
- "1 None alive 569 569 76001 36.4 \n",
- "2 None alive 569 569 164266 27.9 \n",
- "3 None alive 569 569 77384 29.3 \n",
- "4 None alive 569 569 164266 26.3 \n",
- "\n",
- " coordinates_y end_coordinates_x end_coordinates_y receiver_player_id \\\n",
- "0 49.4 36.4 45.1 NaN \n",
- "1 45.1 28.0 39.8 NaN \n",
- "2 39.8 29.1 62.0 NaN \n",
- "3 62.6 26.3 37.6 NaN \n",
- "4 34.3 29.1 7.4 NaN \n",
- "\n",
- " set_piece_type pass_type body_part_type \n",
- "0 KICK_OFF NaN NaN \n",
- "1 NaN NaN NaN \n",
- "2 NaN NaN NaN \n",
- "3 NaN NaN NaN \n",
- "4 NaN NaN NaN "
- ]
- },
- "execution_count": 1,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "from kloppy import opta\n",
- "\n",
- "dataset = opta.load(\n",
- " f7_data=\"../../kloppy/tests/files/opta_f7.xml\",\n",
- " f24_data=\"../../kloppy/tests/files/opta_f24.xml\",\n",
- " \n",
- " # Optional arguments\n",
- " coordinates=\"opta\",\n",
- " event_types=[\"pass\", \"shot\"]\n",
- ")\n",
- "\n",
- "dataset.to_df().head()"
- ]
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "kloppy-venv",
- "language": "python",
- "name": "kloppy-venv"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.10.6"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 5
-}
diff --git a/docs/reference/code-data/index.md b/docs/reference/code-data/index.md
deleted file mode 100644
index a427ac44..00000000
--- a/docs/reference/code-data/index.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# Code Data
-
-This type of data can be collected by hand using tools like SportsCode.
-
-Kloppy allows easy read AND write functionallity for the codes in SportsCode XML format.
diff --git a/docs/reference/domain/code-dataset.md b/docs/reference/domain/code-dataset.md
new file mode 100644
index 00000000..de64bf06
--- /dev/null
+++ b/docs/reference/domain/code-dataset.md
@@ -0,0 +1 @@
+::: kloppy.domain.CodeDataset
diff --git a/docs/reference/domain/event-dataset.md b/docs/reference/domain/event-dataset.md
new file mode 100644
index 00000000..b87dd3e4
--- /dev/null
+++ b/docs/reference/domain/event-dataset.md
@@ -0,0 +1 @@
+::: kloppy.domain.EventDataset
diff --git a/docs/reference/domain/index.md b/docs/reference/domain/index.md
new file mode 100644
index 00000000..9dbdfe2b
--- /dev/null
+++ b/docs/reference/domain/index.md
@@ -0,0 +1,4 @@
+# Domain concepts
+
+Here should come a table which gives an overview of all objects
+in `kloppy.domain`.
diff --git a/docs/reference/metadata/index.md b/docs/reference/domain/metadata/index.md
similarity index 93%
rename from docs/reference/metadata/index.md
rename to docs/reference/domain/metadata/index.md
index 7e361203..92b1b07f 100644
--- a/docs/reference/metadata/index.md
+++ b/docs/reference/domain/metadata/index.md
@@ -1,3 +1,5 @@
# Metadata
One of the main benefits of working with kloppy is that it loads metadata with the event data. This metadata includes teams (name, ground and provider id) and players (name, jersey number, optional position and provider id). Using this metadata, it becomes very easy to create an analysis that is usable by humans, because it includes names instead of only numbers.
+
+::: kloppy.domain.Metadata
diff --git a/docs/reference/domain/formation-type.md b/docs/reference/domain/metadata/team/formation-type.md
similarity index 100%
rename from docs/reference/domain/formation-type.md
rename to docs/reference/domain/metadata/team/formation-type.md
diff --git a/docs/reference/domain/team.md b/docs/reference/domain/metadata/team/index.md
similarity index 100%
rename from docs/reference/domain/team.md
rename to docs/reference/domain/metadata/team/index.md
diff --git a/docs/reference/domain/player.md b/docs/reference/domain/metadata/team/player/index.md
similarity index 100%
rename from docs/reference/domain/player.md
rename to docs/reference/domain/metadata/team/player/index.md
diff --git a/docs/reference/domain/position.md b/docs/reference/domain/metadata/team/player/position.md
similarity index 100%
rename from docs/reference/domain/position.md
rename to docs/reference/domain/metadata/team/player/position.md
diff --git a/docs/reference/domain/tracking-dataset.md b/docs/reference/domain/tracking-dataset.md
new file mode 100644
index 00000000..d0ee640f
--- /dev/null
+++ b/docs/reference/domain/tracking-dataset.md
@@ -0,0 +1 @@
+::: kloppy.domain.TrackingDataset
diff --git a/docs/reference/event-data/index.md b/docs/reference/event-data/index.md
index 4bbdce9d..a55d6c95 100644
--- a/docs/reference/event-data/index.md
+++ b/docs/reference/event-data/index.md
@@ -1,29 +1,5 @@
# Event Data
-An event data feed is a time-coded feed that lists high-level semantic events and player actions in a match. Each record in the feed includes a team, event, type, and timestamp for each action. Furthermore, every event has a series of attributes and qualifiers describing it that depend on the event’s type. You will find explanations of every possible event type, its attributes and qualifiers that are supported in kloppy in our complete lists of Events Types and Qualifier Types.
-
-You can load an example event data set as follows:
-
-```py
-from kloppy import statsbomb
-
-dataset = statsbomb.load_open_data()
-```
-
-An event data feed is deserialized into an EventDataset that groups all events of a single game and provides you with utility functions to navigate and visualize the dataset. Examples illustrating how to load data from other sources can be found in … The following tutorials explain how to analyse the data:
-
-- Loading event stream data
-- Navigating event stream data
-- Visualizing event stream data
-- Attribute transformers
-- Defining custom Event classes
-- Synchronizing event data with tracking data
-- Transforming to a Pandas or Polars dataframe format
-
-In the reminder of this section we describe the standardized data model that kloppy uses for representing event data.
-
-Each event has at least the following attributes:
-
::: kloppy.domain.Event
options:
show_bases: false
diff --git a/docs/reference/providers/datafactory.md b/docs/reference/providers/datafactory.md
new file mode 100644
index 00000000..41ede704
--- /dev/null
+++ b/docs/reference/providers/datafactory.md
@@ -0,0 +1,2 @@
+::: kloppy._providers.datafactory
+
diff --git a/docs/reference/providers/metrica.md b/docs/reference/providers/metrica.md
new file mode 100644
index 00000000..63533756
--- /dev/null
+++ b/docs/reference/providers/metrica.md
@@ -0,0 +1 @@
+::: kloppy._providers.metrica
diff --git a/docs/reference/tracking-data/index.md b/docs/reference/providers/secondspectrum.md
similarity index 100%
rename from docs/reference/tracking-data/index.md
rename to docs/reference/providers/secondspectrum.md
diff --git a/docs/reference/providers/skillcorner.md b/docs/reference/providers/skillcorner.md
new file mode 100644
index 00000000..420a872e
--- /dev/null
+++ b/docs/reference/providers/skillcorner.md
@@ -0,0 +1,2 @@
+
+::: kloppy._providers.skillcorner
diff --git a/docs/reference/providers/sportec.md b/docs/reference/providers/sportec.md
new file mode 100644
index 00000000..8cebc59c
--- /dev/null
+++ b/docs/reference/providers/sportec.md
@@ -0,0 +1,2 @@
+
+::: kloppy._providers.sportec
diff --git a/docs/reference/providers/sportscode.md b/docs/reference/providers/sportscode.md
new file mode 100644
index 00000000..28723e82
--- /dev/null
+++ b/docs/reference/providers/sportscode.md
@@ -0,0 +1,2 @@
+
+::: kloppy._providers.sportscode
diff --git a/docs/reference/providers/statsbomb.md b/docs/reference/providers/statsbomb.md
new file mode 100644
index 00000000..abd2c5d8
--- /dev/null
+++ b/docs/reference/providers/statsbomb.md
@@ -0,0 +1,2 @@
+::: kloppy._providers.statsbomb
+
diff --git a/docs/reference/providers/statsperform.md b/docs/reference/providers/statsperform.md
new file mode 100644
index 00000000..0d970d84
--- /dev/null
+++ b/docs/reference/providers/statsperform.md
@@ -0,0 +1,2 @@
+
+::: kloppy._providers.statsperform
diff --git a/docs/reference/providers/tracab.md b/docs/reference/providers/tracab.md
new file mode 100644
index 00000000..c273b575
--- /dev/null
+++ b/docs/reference/providers/tracab.md
@@ -0,0 +1,2 @@
+
+::: kloppy._providers.tracab
diff --git a/docs/reference/providers/wyscout.md b/docs/reference/providers/wyscout.md
new file mode 100644
index 00000000..d15dbc92
--- /dev/null
+++ b/docs/reference/providers/wyscout.md
@@ -0,0 +1,2 @@
+
+::: kloppy._providers.wyscout
diff --git a/docs/user-guide/code-data.md b/docs/user-guide/code-data.md
new file mode 100644
index 00000000..01097d43
--- /dev/null
+++ b/docs/user-guide/code-data.md
@@ -0,0 +1,15 @@
+# Processing code data
+
+Kloppy allows easy read AND write functionallity for the codes in SportsCode XML format.
+
+## Reading XML file
+
+Lorem ipsum ...
+
+## Writing XML file
+
+Lorem ipsum ...
+
+## Converting event dataset into XML dataset
+
+Lorem ipsum ...
diff --git a/docs/user-guide/datasets/code-data.md b/docs/user-guide/concepts/code-data.md
similarity index 100%
rename from docs/user-guide/datasets/code-data.md
rename to docs/user-guide/concepts/code-data.md
diff --git a/docs/user-guide/concepts/coordinates.md b/docs/user-guide/concepts/coordinates.md
new file mode 100644
index 00000000..e69de29b
diff --git a/docs/user-guide/datasets/event-data.md b/docs/user-guide/concepts/event-data.md
similarity index 57%
rename from docs/user-guide/datasets/event-data.md
rename to docs/user-guide/concepts/event-data.md
index 353e0c61..77fe4c4d 100644
--- a/docs/user-guide/datasets/event-data.md
+++ b/docs/user-guide/concepts/event-data.md
@@ -10,14 +10,4 @@ from kloppy import statsbomb
dataset = statsbomb.load_open_data()
```
-An event data feed is deserialized into an EventDataset that groups all events of a single game and provides you with utility functions to navigate and visualize the dataset. Examples illustrating how to load data from other sources can be found in … The following tutorials explain how to analyse the data:
-
-Loading event stream data
-Navigating event stream data
-Visualizing event stream data
-Attribute transformers
-Defining custom Event classes
-Synchronizing event data with tracking data
-Transforming to a Pandas or Polars dataframe format
-
In the reminder of this section we describe the standardized data model that kloppy uses for representing event data.
diff --git a/docs/user-guide/concepts/formations.md b/docs/user-guide/concepts/formations.md
new file mode 100644
index 00000000..e69de29b
diff --git a/docs/user-guide/concepts/index.md b/docs/user-guide/concepts/index.md
new file mode 100644
index 00000000..2b7e9ef1
--- /dev/null
+++ b/docs/user-guide/concepts/index.md
@@ -0,0 +1,13 @@
+# Concepts
+
+This chapter describes the core concepts of kloppy.
+Understanding these will help you to understand the following chapters.
+We will cover the following topics:
+
+- [Event data](event-data.md)
+- [Tracking data](tracking-data.md)
+- [Metadata](metadata.md)
+- [Coordinates](coordinate-system.md)
+- [Time](time.md)
+- [Formations](formation.md)
+- [Positions](position.md)
diff --git a/docs/user-guide/datasets/metadata.md b/docs/user-guide/concepts/metadata.md
similarity index 100%
rename from docs/user-guide/datasets/metadata.md
rename to docs/user-guide/concepts/metadata.md
diff --git a/docs/user-guide/concepts/positions.md b/docs/user-guide/concepts/positions.md
new file mode 100644
index 00000000..e69de29b
diff --git a/docs/user-guide/concepts/time.md b/docs/user-guide/concepts/time.md
new file mode 100644
index 00000000..e69de29b
diff --git a/docs/user-guide/datasets/tracking-data.md b/docs/user-guide/concepts/tracking-data.md
similarity index 55%
rename from docs/user-guide/datasets/tracking-data.md
rename to docs/user-guide/concepts/tracking-data.md
index 98a103f3..08edfcc3 100644
--- a/docs/user-guide/datasets/tracking-data.md
+++ b/docs/user-guide/concepts/tracking-data.md
@@ -10,9 +10,4 @@ from kloppy import metrica
dataset = metrica.load_open_data(limit=10)
```
-This gives you a TrackingDataset that groups all events of a simple game and provides you with utility functions to navigate the dataset. Examples illustrating how to load data from other sources can be found in … The following tutorials explain how to analyse the data:
-
-Loading tracking data
-Transforming to a Pandas or Polars dataframe format
-
In the remainder of this section we describe the standardised data model that kloppy uses for representing event data.
diff --git a/docs/user-guide/coordinate-system.md b/docs/user-guide/coordinate-system.md
deleted file mode 100644
index dd80435b..00000000
--- a/docs/user-guide/coordinate-system.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# Coordinate system
-
-!!! example
-
- This page should explain all concepts related to the coordinate system,
- such as the pitch dimensions, orientation and origin.
diff --git a/docs/user-guide/dataframe/index.md b/docs/user-guide/dataframe/index.md
new file mode 100644
index 00000000..431d310e
--- /dev/null
+++ b/docs/user-guide/dataframe/index.md
@@ -0,0 +1,23 @@
+# Dataframe output
+
+## `to_df`
+
+Polars vs Pandas
+
+## Selecting output columns
+
+When you want to export a set of attributes you can specify a wildcard pattern. This pattern is matched against all default (exported by the Default Transformer) attributes.
+
+## Adding metadata
+
+The metadata can also be used when transforming a dataset to a pandas dataframe. Using keyword argument additional columns can be created.
+
+## Attribute transformers
+
+Attribute transformer make it possible to add predefined attributes to a dataset. The attributes are calculated during export to a pandas DataFrame. Kloppy does provide some Transformers like one to calculate the angle to the goal, and one to calculate the distance to the goal. When you need additional Transformers you can write your one by providing a Callable to to_df.
+
+## User-defined transformers
+
+Transformers are nothing more than a function which accepts a Event and returns Dict (Callable[[Event], Dict])). The Transformers provided by kloppy are actually classes that define a **call** method. You can also use a lambda function or any other function to transform attributes.
+
+When you use named attributes (specified using a keyword argument) the returned value can be any type (Callable[[Event], Any]).
diff --git a/docs/user-guide/datasets/index.md b/docs/user-guide/datasets/index.md
deleted file mode 100644
index ad22b810..00000000
--- a/docs/user-guide/datasets/index.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Datasets
-
-!!! example
-
- This page should give an overview of the data sources that are used in
- soccer and supported by kloppy. The next pages should explain how to load
- each of these datasets and give an overview of the basic operations.
diff --git a/docs/user-guide/event-data.md b/docs/user-guide/event-data.md
new file mode 100644
index 00000000..9d429e0b
--- /dev/null
+++ b/docs/user-guide/event-data.md
@@ -0,0 +1,12 @@
+# Processing event data
+
+!!! example
+
+ This chapter should give an overview of operations that are supported
+ for event stream data.
+
+## Navigating a dataset
+
+## Adding state
+
+## Event factory
diff --git a/docs/user-guide/getting-started.md b/docs/user-guide/getting-started.md
index bc0770ca..4d838018 100644
--- a/docs/user-guide/getting-started.md
+++ b/docs/user-guide/getting-started.md
@@ -3,8 +3,10 @@
!!! example
This page should contain a 15-min tutorial that introduces the key
- concepts, tools and operations supported by kloppy. Along the way it will
- give pointers to much more detailed information.
+ concepts, tools and operations supported by kloppy. This includes
+ loading event and tracking data, outputting the data to a dataframe,
+ transforming the coordinate system, the metadata, and navigating a dataset.
+ Along the way it will give pointers to much more detailed information.
This chapter is here to help you get started with kloppy. It covers all the fundamental features and functionalities of the library, making it easy for new users to familiarise themselves with the basics from initial installation and setup to core functionalities. If you're already familiar with kloppy's features, feel free to skip ahead to the [next chapter about installation options](installation.md).
@@ -14,19 +16,44 @@ This chapter is here to help you get started with kloppy. It covers all the fund
pip install kloppy
```
-## Loading data
+## Event stream data
-```python exec="true" source="above" session="getting-started/reading"
-from kloppy import statsbomb
+```python exec="true" source="above" session="getting-started"
+from kloppy import metrica
-dataset = statsbomb.load_open_data(event_types=["pass", "shot"])
+API_URL = "https://raw.githubusercontent.com/metrica-sports/sample-data/master/data"
+
+event_dataset = metrica.load_event(
+ meta_data=f"{API_URL}/Sample_Game_3/Sample_Game_3_metadata.xml",
+ event_data=f"{API_URL}/Sample_Game_3/Sample_Game_3_events.json",
+ coordinates="metrica"
+)
+```
+
+```python exec="true" result="text" session="getting-started"
+print(event_dataset.records[0])
```
-```python exec="true" result="text" session="getting-started/reading"
-print(dataset.records[0])
-print(dataset.to_df().head().to_markdown())
+```python exec="true" result="text" session="getting-started"
+print(event_dataset.to_df().head().to_markdown())
```
-```python exec="on" result="text" session="getting-started/reading"
+```python exec="on" result="text" session="getting-started"
--8<-- "python/user-guide/getting-started/reading-writing.py:csv"
```
+
+## Tracking data
+
+```python exec="true" source="above" session="getting-started"
+from kloppy import metrica
+
+API_URL = "https://raw.githubusercontent.com/metrica-sports/sample-data/master/data"
+
+# Load the raw data, we'll only load the first 30 seconds of the game
+tracking_dataset = metrica.load_tracking_epts(
+ meta_data=f"{API_URL}/Sample_Game_3/Sample_Game_3_metadata.xml",
+ raw_data=f"{API_URL}/Sample_Game_3/Sample_Game_3_tracking.txt",
+ limit=30*25,
+ coordinates="metrica"
+)
+```
diff --git a/docs/providers/datafactory.ipynb b/docs/user-guide/providers/datafactory.ipynb
similarity index 100%
rename from docs/providers/datafactory.ipynb
rename to docs/user-guide/providers/datafactory.ipynb
diff --git a/docs/user-guide/providers/index.md b/docs/user-guide/providers/index.md
new file mode 100644
index 00000000..3186c7b7
--- /dev/null
+++ b/docs/user-guide/providers/index.md
@@ -0,0 +1,8 @@
+# Loading data
+
+!!! example
+
+ This page should give an overview of the data sources that are used in
+ soccer and supported by kloppy and introduce adatapter.
+ The next pages should explain how to load each of these datasets and give
+ an overview of the basic operations.
diff --git a/docs/providers/metrica.ipynb b/docs/user-guide/providers/metrica.ipynb
similarity index 100%
rename from docs/providers/metrica.ipynb
rename to docs/user-guide/providers/metrica.ipynb
diff --git a/docs/providers/secondspectrum.ipynb b/docs/user-guide/providers/secondspectrum.ipynb
similarity index 100%
rename from docs/providers/secondspectrum.ipynb
rename to docs/user-guide/providers/secondspectrum.ipynb
diff --git a/docs/providers/skillcorner.ipynb b/docs/user-guide/providers/skillcorner.ipynb
similarity index 100%
rename from docs/providers/skillcorner.ipynb
rename to docs/user-guide/providers/skillcorner.ipynb
diff --git a/docs/providers/sportec.ipynb b/docs/user-guide/providers/sportec.ipynb
similarity index 100%
rename from docs/providers/sportec.ipynb
rename to docs/user-guide/providers/sportec.ipynb
diff --git a/docs/providers/sportscode.ipynb b/docs/user-guide/providers/sportscode.ipynb
similarity index 100%
rename from docs/providers/sportscode.ipynb
rename to docs/user-guide/providers/sportscode.ipynb
diff --git a/docs/providers/statsbomb.ipynb b/docs/user-guide/providers/statsbomb.ipynb
similarity index 100%
rename from docs/providers/statsbomb.ipynb
rename to docs/user-guide/providers/statsbomb.ipynb
diff --git a/docs/providers/statsperform.ipynb b/docs/user-guide/providers/statsperform.ipynb
similarity index 100%
rename from docs/providers/statsperform.ipynb
rename to docs/user-guide/providers/statsperform.ipynb
diff --git a/docs/providers/tracab.ipynb b/docs/user-guide/providers/tracab.ipynb
similarity index 100%
rename from docs/providers/tracab.ipynb
rename to docs/user-guide/providers/tracab.ipynb
diff --git a/docs/providers/wyscout.ipynb b/docs/user-guide/providers/wyscout.ipynb
similarity index 100%
rename from docs/providers/wyscout.ipynb
rename to docs/user-guide/providers/wyscout.ipynb
diff --git a/docs/user-guide/state.md b/docs/user-guide/state.md
deleted file mode 100644
index f7f24d02..00000000
--- a/docs/user-guide/state.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# State
-
-!!! example
-
- This page should explain how to use state.
diff --git a/docs/user-guide/tracking-data.md b/docs/user-guide/tracking-data.md
new file mode 100644
index 00000000..5bb6d0ac
--- /dev/null
+++ b/docs/user-guide/tracking-data.md
@@ -0,0 +1,6 @@
+# Processing tracking data
+
+!!! example
+
+ This chapter should give an overview of operations that are supported
+ for event stream data
diff --git a/docs/user-guide/transformations/dimensions.md b/docs/user-guide/transformations/dimensions.md
new file mode 100644
index 00000000..e69de29b
diff --git a/docs/user-guide/transformations/index.md b/docs/user-guide/transformations/index.md
index d9323524..36638361 100644
--- a/docs/user-guide/transformations/index.md
+++ b/docs/user-guide/transformations/index.md
@@ -1,5 +1,5 @@
-# Transformations
+# Dataset transformations
!!! example
- This page should explain how dataset transformations work.
+ This chapter should explain how dataset transformations work.
diff --git a/docs/user-guide/transformations/orientation.md b/docs/user-guide/transformations/orientation.md
new file mode 100644
index 00000000..e69de29b
diff --git a/mkdocs.yml b/mkdocs.yml
index 066e7f4e..336aa88c 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -23,67 +23,80 @@ nav:
- index.md
- Getting started: user-guide/getting-started.md
- Installation: user-guide/installation.md
- - Datasets:
- - user-guide/datasets/index.md
- - Event data: user-guide/datasets/event-data.md
- - Tracking data: user-guide/datasets/tracking-data.md
- - Code data: user-guide/datasets/code-data.md
- - Metadata: user-guide/datasets/metadata.md
- - Coordinate system: user-guide/coordinate-system.md
- - Transformations:
+ - Concepts:
+ - user-guide/concepts/index.md
+ - Event data: user-guide/concepts/event-data.md
+ - Tracking data: user-guide/concepts/tracking-data.md
+ - Code data: user-guide/concepts/code-data.md
+ - Metadata: user-guide/concepts/metadata.md
+ - Coordinates: user-guide/concepts/coordinates.md
+ - Time: user-guide/concepts/time.md
+ - Positions: user-guide/concepts/positions.md
+ - Formations: user-guide/concepts/formations.md
+ - Loading data:
+ - user-guide/providers/index.md
+ - Datafactory: user-guide/providers/datafactory.ipynb
+ - Metrica: user-guide/providers/metrica.ipynb
+ - SecondSpectrum: user-guide/providers/secondspectrum.ipynb
+ - SkillCorner: user-guide/providers/skillcorner.ipynb
+ - Sportec: user-guide/providers/sportec.ipynb
+ - Sportscode: user-guide/providers/sportscode.ipynb
+ - Statsbomb: user-guide/providers/statsbomb.ipynb
+ - StatsPerform: user-guide/providers/statsperform.ipynb
+ - TRACAB: user-guide/providers/tracab.ipynb
+ - Wyscout: user-guide/providers/wyscout.ipynb
+ - Transforming data:
- user-guide/transformations/index.md
- - State: user-guide/state.md
+ - Pitch dimensions: user-guide/transformations/dimensions.md
+ - Orientation: user-guide/transformations/orientation.md
+ - Processing data:
+ - Event data: user-guide/event-data.md
+ - Tracking data: user-guide/tracking-data.md
+ - Code data: user-guide/code-data.md
+ - Dataframe ouput: user-guide/dataframe/index.md
- Configuration: user-guide/configuration.md
- How-to guides:
- examples/index.md
- Loading data from external sources: examples/adapter.ipynb
- # - Event Data: examples/event_data.ipynb
- # - Tracking Data: examples/tracking_data.ipynb
- # - Broadcast Tracking Data: examples/broadcast_tracking_data.ipynb
- # - Code data: examples/code_data.ipynb
- # - State: examples/state.ipynb
- # - Navigating: examples/navigating.ipynb
- # - Plotting: examples/plotting.ipynb
- # - Config: examples/config.ipynb
- - Providers:
- - providers/index.md
- - Datafactory: providers/datafactory.ipynb
- - Metrica: providers/metrica.ipynb
- - Opta: providers/opta.ipynb
- - SecondSpectrum: providers/secondspectrum.ipynb
- - SkillCorner: providers/skillcorner.ipynb
- - Sportec: providers/sportec.ipynb
- - Sportscode: providers/sportscode.ipynb
- - Statsbomb: providers/statsbomb.ipynb
- - StatsPerform: providers/statsperform.ipynb
- - TRACAB: providers/tracab.ipynb
- - Wyscout: providers/wyscout.ipynb
+ - Analyzing SportsCode XML files with DuckDB: 'presentations/pysport-meetup-april-2023/Kloppy x DuckDB.ipynb'
- Reference:
- reference/index.md
- Domain Concepts:
- - Team: reference/domain/team.md
- - FormationType: reference/domain/formation-type.md
- - Player: reference/domain/player.md
- - Position: reference/domain/position.md
- - Ground: reference/domain/ground.md
- - Score: reference/domain/score.md
- - Provider: reference/domain/provider.md
- - Orientation: reference/domain/orientation.md
- - Datasets:
- - Event Data:
- - Overview: reference/event-data/index.md
- - Event Types:
- - Oveview: reference/event-data/event-types/index.md
- - Pass: reference/event-data/event-types/pass.md
- - Qualifiers:
- - Overview: reference/event-data/qualifiers/index.md
- - SetPieceQualifier: references/event-data/qualifiers/set-piece.md
- - Tracking Data:
- - Overview: reference/tracking-data/index.md
- - Code Data:
- - Overview: reference/code-data/index.md
- - Metadata:
- - Overview: reference/metadata/index.md
+ - reference/domain/index.md
+ - EventDataset: reference/domain/event-dataset.md
+ - TrackingDataset: reference/domain/tracking-dataset.md
+ - CodeDataset: reference/domain/code-dataset.md
+ - Metadata:
+ - reference/domain/metadata/index.md
+ - Team:
+ - reference/domain/metadata/team/index.md
+ - FormationType: reference/domain/metadata/team/formation-type.md
+ - Player:
+ - reference/domain/metadata/team/player/index.md
+ - Position: reference/domain/metadata/team/player/position.md
+ - Ground: reference/domain/ground.md
+ - Score: reference/domain/score.md
+ - Provider: reference/domain/provider.md
+ - Orientation: reference/domain/orientation.md
+ - Data loaders:
+ - Datafactory: reference/providers/datafactory.md
+ - Metrica: reference/providers/metrica.md
+ - SecondSpectrum: reference/providers/secondspectrum.md
+ - SkillCorner: reference/providers/skillcorner.md
+ - Sportec: reference/providers/sportec.md
+ - Sportscode: reference/providers/sportscode.md
+ - Statsbomb: reference/providers/statsbomb.md
+ - StatsPerform: reference/providers/statsperform.md
+ - TRACAB: reference/providers/tracab.md
+ - Wyscout: reference/providers/wyscout.md
+ - Event Data Model:
+ - reference/event-data/index.md
+ - Event Types:
+ - Oveview: reference/event-data/event-types/index.md
+ - Pass: reference/event-data/event-types/pass.md
+ - Qualifiers:
+ - Overview: reference/event-data/qualifiers/index.md
+ - SetPieceQualifier: references/event-data/qualifiers/set-piece.md
- Development:
- Issues: 'issues.md'
- Contributing: 'contributing.md'