The memory connector allows saving dataframes and variables in memory for communication between successive wrangles and recipes. All contents of the memory connector are lost once the python script finishes executing.
read:
- memory:
id: '1234'
from wrangles.connectors import memory
df = memory.read(id='1234')
Parameter | Required | Data Type | Notes |
---|---|---|---|
id | str | A unique ID to identify the data. If not specified, will read the last dataframe saved in memory | |
orient | str | Set the arrangement of the data. See pandas.DataFrame.to_dict method for options. Defaults to tight. | |
order_by | str | Uses SQL syntax to sort the input. |
write:
- memory
id: '1234'
from wrangles.connectors import memory
import pandas as pd
df = pd.read_csv('example.csv')
memory.write(df=df, id='1234')
Parameter | Required | Data Type | Notes |
---|---|---|---|
df | ✓ | pandas dataframe | Dataframe to be exported |
id | str | A unique ID to identify the data. If not specified, will read the last dataframe saved in memory | |
orient | str | Set the arrangement of the data. See pandas.DataFrame.to_dict method for options. Defaults to tight. | |
order_by | str | Uses SQL syntax to sort the output. |
Clear and reset any existing data stored in the connector.
from wrangles.connectors import memory
import pandas as pd
df = pd.read_csv('example.csv')
memory.write(df=df, id='1234')
memory.clear()