In [1]:
Copied!
from kloppy import datafactory
dataset = datafactory.load(
event_data="../../kloppy/tests/files/datafactory_events.json",
# Optional arguments
coordinates="datafactory",
event_types=["shot", "pass"]
)
dataset.to_df().head()
from kloppy import datafactory
dataset = datafactory.load(
event_data="../../kloppy/tests/files/datafactory_events.json",
# Optional arguments
coordinates="datafactory",
event_types=["shot", "pass"]
)
dataset.to_df().head()
Out[1]:
event_id | event_type | result | success | period_id | timestamp | end_timestamp | ball_state | ball_owning_team | team_id | player_id | coordinates_x | coordinates_y | end_coordinates_x | end_coordinates_y | receiver_player_id | set_piece_type | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 22094464 | PASS | COMPLETE | True | 1 | 3 | 3.0 | alive | 279 | 279 | 40975 | 0.01 | 0.01 | 0.26 | -0.05 | 93357 | KICK_OFF |
1 | 22094465 | PASS | COMPLETE | True | 1 | 6 | 6.0 | alive | 279 | 279 | 93357 | 0.33 | -0.13 | 0.38 | -0.29 | 11458 | NaN |
2 | 22094466 | PASS | COMPLETE | True | 1 | 8 | 8.0 | alive | 279 | 279 | 11458 | 0.45 | -0.49 | 0.44 | -0.78 | 62686 | NaN |
3 | 22094467 | PASS | COMPLETE | True | 1 | 10 | 10.0 | alive | 279 | 279 | 62686 | 0.44 | -0.85 | 0.79 | -0.30 | 41488 | NaN |
4 | 22094468 | PASS | COMPLETE | True | 1 | 16 | 16.0 | alive | 279 | 279 | 41488 | 0.76 | -0.31 | -0.25 | -0.19 | 40975 | NaN |