load

DataFrame.load()[source]

Loads saved data from disk.

The data frame object holding the same name as the current DataFrame instance will be loaded from disk into the getML engine and updates the current handler using refresh().

Examples:

First, we have to create and imporimport data sets.

d, _ = getml.datasets.make_numerical(population_name = 'test')
getml.data.list_data_frames()

In the output of list_data_frames() we can find our underlying data frame object ‘test’ listed under the ‘in_memory’ key (it was created and imported by make_numerical()). This means the getML engine does only hold it in memory (RAM) yet and we still have to save() it to disk in order to load() it again or to prevent any loss of information between different sessions.

d.save()
getml.data.list_data_frames()
d2 = getml.DataFrame(name = 'test').load()
Returns:
DataFrame:

Updated handle the underlying data frame in the getML engine.

Note:

When invoking load() all changes of the underlying data frame object that took place after the last call to the save() method will be lost. Thus, this method enables you to undo changes applied to the DataFrame.

d, _ = getml.datasets.make_numerical()
d.save()

# Accidental change we want to undo
d.rm('column_01')

d.load()

If save() hasn’t be called on the current instance yet or it wasn’t stored to disk in a previous session, load() will throw an exception

File or directory ‘../projects/X/data/Y/’ not found!

Alternatively, load_data_frame() offers an easier way of creating DataFrame handlers to data in the getML engine.