get_dataset

get_dataset()

Get, check or clear the default dataset.

Companions to use_dataset() for inspecting and resetting the session’s default dataset. has_dataset() is the safe way to check before calling get_dataset(), which errors when nothing is set. clear_dataset() removes the default so that subsequent calls require an explicit data again: useful at the end of a script or between analyses of different datasets.

Returns

Name Type Description
pandas.DataFrame get_dataset() returns the default data frame (error if none is set); has_dataset() returns a bool; clear_dataset() returns True; dataset_vars() returns a list of column names.

See Also

use_dataset

Examples

>>> has_dataset()
>>> use_dataset(podracing_survey)
>>> has_dataset()
>>> len(get_dataset())
>>> clear_dataset()