class documentation
class MemoryDataSet(AbstractDataSet): (source)
MemoryDataSet loads and saves data from/to an in-memory Python object.
Example:
>>> from kedro.io import MemoryDataSet >>> import pandas as pd >>> >>> data = pd.DataFrame({'col1': [1, 2], 'col2': [4, 5], >>> 'col3': [5, 6]}) >>> data_set = MemoryDataSet(data=data) >>> >>> loaded_data = data_set.load() >>> assert loaded_data.equals(data) >>> >>> new_data = pd.DataFrame({'col1': [1, 2], 'col2': [4, 5]}) >>> data_set.save(new_data) >>> reloaded_data = data_set.load() >>> assert reloaded_data.equals(new_data)
Method | __init__ |
Creates a new instance of MemoryDataSet pointing to the provided Python object. |
Method | _describe |
Undocumented |
Method | _exists |
Undocumented |
Method | _load |
Undocumented |
Method | _release |
Undocumented |
Method | _save |
Undocumented |
Instance Variable | _copy |
Undocumented |
Instance Variable | _data |
Undocumented |
Inherited from AbstractDataSet
:
Class Method | from |
Create a data set instance using the configuration provided. |
Method | __str__ |
Undocumented |
Method | exists |
Checks whether a data set's output already exists by calling the provided _exists() method. |
Method | load |
Loads data by delegation to the provided load method. |
Method | release |
Release any cached data. |
Method | save |
Saves data by delegation to the provided save method. |
Method | _copy |
Undocumented |
Property | _logger |
Undocumented |
Creates a new instance of MemoryDataSet pointing to the provided Python object.
Parameters | |
data:Any | Python object containing the data. |
copystr | The copy mode used to copy the data. Possible values are: "deepcopy", "copy" and "assign". If not provided, it is inferred based on the data type. |