Index
kloppy.domain.CodeDataset
dataclass
A dataset containing SportsCode annotations.
ATTRIBUTE | DESCRIPTION |
---|---|
dataset_type |
TYPE:
|
codes |
A list of codes. Alias for
TYPE:
|
metadata |
Metadata of the code dataset.
TYPE:
|
to_pandas
Source code in kloppy/domain/models/code.py
filter
Filter all records used filter_
PARAMETER | DESCRIPTION |
---|---|
filter_
|
The filter to be used to filter the records. It can be a callable that takes a record and returns a boolean, or a string representing a css-like selector.
TYPE:
|
Examples:
1 2 3 |
|
from_dataset
classmethod
Create a new Dataset from other dataset
PARAMETER | DESCRIPTION |
---|---|
mapper_fn
|
TYPE:
|
Examples:
>>> code_dataset = (
>>> CodeDataset
>>> .from_dataset(
>>> dataset,
>>> lambda event: Code(
>>> code_id=event.event_id,
>>> code=event.event_name,
>>> period=event.period,
>>> timestamp=event.timestamp - 7,
>>> end_timestamp=event.timestamp + 5,
>>> labels={
>>> 'Player': str(event.player),
>>> 'Team': str(event.team)
>>> }
>>> )
>>> )
>>> )