diff --git a/docs/changelog.md b/docs/changelog.md index 7a31787b..813ea6c7 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -3,6 +3,17 @@ Find out all changes between different kloppy versions +## 3.8.0 (2023-03-05) + +Pull requests merged: +- Fix for Incorrect home/away mapping in Statsbomb metadata ([#174](https://github.com/PySport/kloppy/pull/174)) +- Added extra formations ([#166](https://github.com/PySport/kloppy/pull/166)) +- Set correct orientation for Metrica EPTS ([#168](https://github.com/PySport/kloppy/pull/168)) +- Add polars support ([#172](https://github.com/PySport/kloppy/pull/172)) + +Important changes: +- `to_pandas` is deprecated, `to_df` should be used. `to_df` is now a method on all Dataset types (event, tracking and code), and accepts an additional `engine` keyword argument that can be `polars` or `pandas`. The default value is `pandas` but can be changed using the config variable `dataframe.engine` + ## 3.7.1 (2023-01-16) Pull requests merged: diff --git a/docs/examples/event_data.ipynb b/docs/examples/event_data.ipynb index 10fb241f..191f8c01 100644 --- a/docs/examples/event_data.ipynb +++ b/docs/examples/event_data.ipynb @@ -957,6 +957,503 @@ ")" ] }, + { + "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", + "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", + "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", + ""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", + ""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", + ""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", + ""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", + ""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", + "