zcollection.dataset.Dataset.select_variables_by_dims#

Dataset.select_variables_by_dims(dims, predicate=True)[source]#

Return a new dataset with only the variables that have the specified dimensions if predicate is true, otherwise return a new dataset with only the variables that do not have the specified dimensions.

Parameters:
  • dims (Sequence[str]) – Dimensions to select.

  • predicate (bool) – If true, select variables with the specified dimensions, otherwise select variables without the specified dimensions.

Returns:

New dataset or None if no variables match the predicate.

Return type:

Dataset