pymovements.datasets.dataset.Dataset.take_subset#
- static Dataset.take_subset(fileinfo: pl.DataFrame, subset: None | dict[str, bool | float | int | str | list[bool | float | int | str]] = None) pl.DataFrame[source]#
Take a subset of the dataset.
Calling this method will alter the fileinfo attribute.
- Parameters:
fileinfo (pl.DataFrame) – File information dataframe.
subset (dict, optional) – If specified, take a subset of the dataset. All keys in the dictionary must be present in the fileinfo dataframe inferred by infer_fileinfo(). Values can be either bool, float, int , str or a list of these.
- Returns:
Subset of file information dataframe.
- Return type:
pl.DataFrame
- Raises:
ValueError – If dictionary key is not a column in the fileinfo dataframe.
TypeError – If dictionary key or value is not of valid type.