zcollection.collection.Collection.load#
- Collection.load(*, filters=None, indexer=None, selected_variables=None)[source]#
Load the selected partitions.
- Parameters
filters (Optional[Union[str, Callable[[Dict[str, int]], bool]]]) – The predicate used to filter the partitions to load. To get more information on the predicate, see the documentation of the
partitions()
method.selected_variables (Optional[Iterable[str]]) – A list of variables to retain from the collection. If None, all variables are kept.
- Returns
The dataset containing the selected partitions.
- Return type
Warning
If you select variables to load from the collection, do not insert the returned dataset otherwise all skipped variables will be reset with fill values.
Example
>>> collection = ... >>> collection.load( ... filters="year=2019 and month=3 and day % 2 == 0") >>> collection.load( ... filters=lambda keys: keys["year"] == 2019 and ... keys["month"] == 3 and keys["day"] % 2 == 0)