Skip to content

Tracking

Dataset

kloppy.domain.models.tracking.TrackingDataset (Dataset) dataclass

TrackingDataset(args, *kwds)

filter(self, filter_) inherited

Filter all records used filter_

Parameters:

Name Type Description Default
- filter_ required

Examples:

>>> from kloppy.domain import EventType
>>> dataset = dataset.filter(lambda event: event.event_type == EventType.PASS)
>>> dataset = dataset.filter('pass')
Source code in kloppy/domain/models/tracking.py
def filter(self, filter_):
    """
    Filter all records used `filter_`

    Arguments:
        - filter_:

    Examples:
        >>> from kloppy.domain import EventType
        >>> dataset = dataset.filter(lambda event: event.event_type == EventType.PASS)
        >>> dataset = dataset.filter('pass')
    """
    return replace(
        self,
        records=self.find_all(filter_),
    )

transform(self, *args, **kwargs) inherited

See [transform][kloppy.helpers.transform]

Source code in kloppy/domain/models/tracking.py
def transform(self, *args, **kwargs):
    """
    See [transform][kloppy.helpers.transform]
    """
    from kloppy.helpers import transform

    return transform(self, *args, **kwargs)