class documentation

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_mode Undocumented
Instance Variable _data Undocumented

Inherited from AbstractDataSet:

Class Method from_config 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
def __init__(self, data: Any = _EMPTY, copy_mode: str = None): (source)

Creates a new instance of MemoryDataSet pointing to the provided Python object.

Parameters
data:AnyPython object containing the data.
copy_mode:strThe 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.
def _describe(self) -> Dict[str, Any]: (source)

Undocumented

def _exists(self) -> bool: (source)

Undocumented

def _load(self) -> Any: (source)

Undocumented

def _release(self): (source)

Undocumented

def _save(self, data: Any): (source)

Undocumented

_copy_mode = (source)

Undocumented

Undocumented