DataLoader#

class data_morph.data.loader.DataLoader[source]#

Bases: object

Class for loading datasets for morphing.

../_images/data_morph-data-loader-DataLoader-1.png

Datasets currently included in data_morph. Note that CSV files are also supported by load_dataset().#

AVAILABLE_DATASETS = ['cat', 'dino', 'dog', 'music', 'panda', 'sheep']#

List of available built-in starter datasets, which can be visualized with plot_available_datasets().

Type:

list[str]

classmethod load_dataset(dataset: str, scale: Number | None = None) Dataset[source]#

Load dataset.

Parameters:
  • dataset (str) – Either one of AVAILABLE_DATASETS or 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:

Dataset

Notes

If you are looking to create a Dataset from a DataFrame object, use the Dataset class directly.

classmethod plot_available_datasets() Axes[source]#

Plot the built-in datasets.

Returns:

The Axes object containing the plot.

Return type:

matplotlib.axes.Axes

See also

AVAILABLE_DATASETS

The list of available datasets built into data_morph.