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 usingrefresh()
.- 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 bymake_numerical()
). This means the getML engine does only hold it in memory (RAM) yet and we still have tosave()
it to disk in order toload()
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 thesave()
method will be lost. Thus, this method enables you to undo changes applied to theDataFrame
.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 exceptionFile or directory ‘../projects/X/data/Y/’ not found!
Alternatively,
load_data_frame()
offers an easier way of creatingDataFrame
handlers to data in the getML engine.