Skip to content

DatasetNotFoundError

DatasetNotFoundError(
    message: str, *, name: str, available: list[str]
)

Bases: ggrust.errors.GgrustError, builtins.AttributeError

Raised when ggrust.data has no dataset of the asked name.

It is an AttributeError, so from ggrust.data import name raises ImportError as for any missing module attribute.

Parameters:

  • message (str) –

    The full message: the name, the available datasets and a close match.

  • name (str) –

    The name that was asked for.

  • available (list of str) –

    The dataset names.

Examples:

>>> import ggrust.data
>>> from ggrust.errors import DatasetNotFoundError
>>> try:
...     frame = ggrust.data.pengiuns
... except DatasetNotFoundError as error:
...     print(error.available)
['economics', 'iris', 'mpg', 'penguins']