DataLoader#
- class data_morph.data.loader.DataLoader[source]#
Bases:
objectClass for loading datasets for morphing.
Datasets currently included in Data Morph. The
dinoshape is Alberto Cairo’s Datasaurus. All logos are used with permission (see below). Note that CSV files are also supported by theload_dataset()method.#Important
All logos are used with permission.
The Python logo is a trademark of the Python Software Foundation (PSF), used with permission from the Foundation.
The SuperDataScience (SDS) logo is used with permission.
- AVAILABLE_DATASETS = ['bunny', 'cat', 'dino', 'dog', 'gorilla', 'music', 'panda', 'pi', 'Python', 'SDS', 'sheep', 'soccer']#
List of available built-in starter datasets, which can be visualized with
plot_available_datasets().
- classmethod load_dataset(dataset: str, scale: Number | None = None) Dataset[source]#
Load dataset.
- Parameters:
dataset (str) – Either one of
AVAILABLE_DATASETSor a path to a CSV file containing two columns: x and y.scale (numbers.Number, optional) – The factor to scale the data by (can be used to speed up morphing). Values in the data’s x and y columns will be divided by this value.
- Returns:
The starting dataset for morphing.
- Return type:
Notes
If you are looking to create a
Datasetfrom aDataFrameobject, use theDatasetclass directly.
- classmethod plot_available_datasets() Axes[source]#
Plot the built-in datasets.
- Returns:
The
Axesobject containing the plot.- Return type:
See also
AVAILABLE_DATASETSThe list of available datasets built into Data Morph.