diff --git a/docs/getting-started/sportec.ipynb b/docs/getting-started/sportec.ipynb
index 399f8bb4..51227d12 100644
--- a/docs/getting-started/sportec.ipynb
+++ b/docs/getting-started/sportec.ipynb
@@ -7,13 +7,13 @@
"source": [
"# Sportec\n",
"\n",
- "## Load local files"
+ "## Load local event files"
]
},
{
"cell_type": "code",
"execution_count": 1,
- "id": "e9adb7cb",
+ "id": "4f6455fb",
"metadata": {},
"outputs": [
{
@@ -77,7 +77,7 @@
"
38.71 | \n",
" DFL-OBJ-0000ZS | \n",
" KICK_OFF | \n",
- " NaN | \n",
+ " None | \n",
" \n",
" \n",
" 1 | \n",
@@ -97,8 +97,8 @@
" NaN | \n",
" NaN | \n",
" DFL-OBJ-002G3I | \n",
- " NaN | \n",
- " NaN | \n",
+ " None | \n",
+ " None | \n",
"
\n",
" \n",
" 2 | \n",
@@ -119,7 +119,7 @@
" 28.58 | \n",
" DFL-OBJ-0027B9 | \n",
" THROW_IN | \n",
- " NaN | \n",
+ " None | \n",
"
\n",
" \n",
" 3 | \n",
@@ -138,8 +138,8 @@
" 28.58 | \n",
" NaN | \n",
" NaN | \n",
- " NaN | \n",
- " NaN | \n",
+ " None | \n",
+ " None | \n",
" RIGHT_FOOT | \n",
"
\n",
" \n",
@@ -160,8 +160,8 @@
" NaN | \n",
" NaN | \n",
" None | \n",
- " NaN | \n",
- " NaN | \n",
+ " None | \n",
+ " None | \n",
"
\n",
" \n",
"\n",
@@ -190,11 +190,11 @@
"4 8.72 4.21 NaN NaN \n",
"\n",
" receiver_player_id set_piece_type body_part_type \n",
- "0 DFL-OBJ-0000ZS KICK_OFF NaN \n",
- "1 DFL-OBJ-002G3I NaN NaN \n",
- "2 DFL-OBJ-0027B9 THROW_IN NaN \n",
- "3 NaN NaN RIGHT_FOOT \n",
- "4 None NaN NaN "
+ "0 DFL-OBJ-0000ZS KICK_OFF None \n",
+ "1 DFL-OBJ-002G3I None None \n",
+ "2 DFL-OBJ-0027B9 THROW_IN None \n",
+ "3 None None RIGHT_FOOT \n",
+ "4 None None None "
]
},
"execution_count": 1,
@@ -205,7 +205,7 @@
"source": [
"from kloppy import sportec\n",
"\n",
- "dataset = sportec.load(\n",
+ "dataset = sportec.load_event(\n",
" event_data=\"../../kloppy/tests/files/sportec_events.xml\",\n",
" meta_data=\"../../kloppy/tests/files/sportec_meta.xml\",\n",
" \n",
@@ -216,6 +216,258 @@
"\n",
"dataset.to_df().head()"
]
+ },
+ {
+ "cell_type": "markdown",
+ "id": "81989fc6",
+ "metadata": {},
+ "source": [
+ "# Load local tracking files"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "id": "958f17ee",
+ "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",
+ " ball_speed | \n",
+ " DFL-OBJ-002G3I_x | \n",
+ " ... | \n",
+ " DFL-OBJ-002G3I_d | \n",
+ " DFL-OBJ-002G3I_s | \n",
+ " DFL-OBJ-002G5S_x | \n",
+ " DFL-OBJ-002G5S_y | \n",
+ " DFL-OBJ-002G5S_d | \n",
+ " DFL-OBJ-002G5S_s | \n",
+ " DFL-OBJ-002FVJ_x | \n",
+ " DFL-OBJ-002FVJ_y | \n",
+ " DFL-OBJ-002FVJ_d | \n",
+ " DFL-OBJ-002FVJ_s | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 0 | \n",
+ " 1 | \n",
+ " 0.00 | \n",
+ " 10000 | \n",
+ " dead | \n",
+ " DFL-CLU-000004 | \n",
+ " 2.69 | \n",
+ " 0.26 | \n",
+ " 0.06 | \n",
+ " 0.00 | \n",
+ " 0.35 | \n",
+ " ... | \n",
+ " None | \n",
+ " 0.00 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " None | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " None | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " 1 | \n",
+ " 1 | \n",
+ " 0.04 | \n",
+ " 10001 | \n",
+ " alive | \n",
+ " DFL-CLU-00000A | \n",
+ " 3.41 | \n",
+ " 0.26 | \n",
+ " 0.08 | \n",
+ " 65.59 | \n",
+ " 0.34 | \n",
+ " ... | \n",
+ " None | \n",
+ " 1.74 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " None | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " None | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " 2 | \n",
+ " 1 | \n",
+ " 0.08 | \n",
+ " 10002 | \n",
+ " alive | \n",
+ " DFL-CLU-000004 | \n",
+ " 4.22 | \n",
+ " 0.33 | \n",
+ " 0.09 | \n",
+ " 65.16 | \n",
+ " 0.32 | \n",
+ " ... | \n",
+ " None | \n",
+ " 1.76 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " None | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " None | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " 3 | \n",
+ " 1 | \n",
+ " 0.12 | \n",
+ " 10003 | \n",
+ " alive | \n",
+ " DFL-CLU-000004 | \n",
+ " 5.02 | \n",
+ " 0.38 | \n",
+ " 0.09 | \n",
+ " 74.34 | \n",
+ " 0.31 | \n",
+ " ... | \n",
+ " None | \n",
+ " 1.78 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " None | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " None | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ " 4 | \n",
+ " 1 | \n",
+ " 0.16 | \n",
+ " 10004 | \n",
+ " alive | \n",
+ " DFL-CLU-000004 | \n",
+ " 5.79 | \n",
+ " 0.44 | \n",
+ " 0.08 | \n",
+ " 73.58 | \n",
+ " 0.29 | \n",
+ " ... | \n",
+ " None | \n",
+ " 1.80 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " None | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " None | \n",
+ " NaN | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
5 rows × 21 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " period_id timestamp frame_id ball_state ball_owning_team_id ball_x \\\n",
+ "0 1 0.00 10000 dead DFL-CLU-000004 2.69 \n",
+ "1 1 0.04 10001 alive DFL-CLU-00000A 3.41 \n",
+ "2 1 0.08 10002 alive DFL-CLU-000004 4.22 \n",
+ "3 1 0.12 10003 alive DFL-CLU-000004 5.02 \n",
+ "4 1 0.16 10004 alive DFL-CLU-000004 5.79 \n",
+ "\n",
+ " ball_y ball_z ball_speed DFL-OBJ-002G3I_x ... DFL-OBJ-002G3I_d \\\n",
+ "0 0.26 0.06 0.00 0.35 ... None \n",
+ "1 0.26 0.08 65.59 0.34 ... None \n",
+ "2 0.33 0.09 65.16 0.32 ... None \n",
+ "3 0.38 0.09 74.34 0.31 ... None \n",
+ "4 0.44 0.08 73.58 0.29 ... None \n",
+ "\n",
+ " DFL-OBJ-002G3I_s DFL-OBJ-002G5S_x DFL-OBJ-002G5S_y DFL-OBJ-002G5S_d \\\n",
+ "0 0.00 NaN NaN None \n",
+ "1 1.74 NaN NaN None \n",
+ "2 1.76 NaN NaN None \n",
+ "3 1.78 NaN NaN None \n",
+ "4 1.80 NaN NaN None \n",
+ "\n",
+ " DFL-OBJ-002G5S_s DFL-OBJ-002FVJ_x DFL-OBJ-002FVJ_y DFL-OBJ-002FVJ_d \\\n",
+ "0 NaN NaN NaN None \n",
+ "1 NaN NaN NaN None \n",
+ "2 NaN NaN NaN None \n",
+ "3 NaN NaN NaN None \n",
+ "4 NaN NaN NaN None \n",
+ "\n",
+ " DFL-OBJ-002FVJ_s \n",
+ "0 NaN \n",
+ "1 NaN \n",
+ "2 NaN \n",
+ "3 NaN \n",
+ "4 NaN \n",
+ "\n",
+ "[5 rows x 21 columns]"
+ ]
+ },
+ "execution_count": 3,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "from kloppy import sportec\n",
+ "\n",
+ "\n",
+ "dataset = sportec.load_tracking(\n",
+ " raw_data=\"../../kloppy/tests/files/sportec_positional.xml\",\n",
+ " meta_data=\"../../kloppy/tests/files/sportec_meta.xml\",\n",
+ " \n",
+ " # Optional arguments\n",
+ " coordinates=\"sportec\",\n",
+ " only_alive=False\n",
+ ")\n",
+ "\n",
+ "dataset.to_df().head()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "id": "366f1126",
+ "metadata": {},
+ "outputs": [],
+ "source": []
}
],
"metadata": {