DataBox
This is a description of the DataBox
class. It is intended to be used as a container to store dataframes and allow them to be
accessible by name to downstream ETL steps.
To use this class
from datarails.contexts import DataBox
Bases: _BaseContext
DataBox provides an interface to interact with its DataFrame data.
Source code in datarails/contexts.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
|
__str__()
Returns a string representation of the DataBox.
Source code in datarails/contexts.py
83 84 85 |
|
delete_df(name)
Deletes a DataFrame from the DataBox based on its name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the DataFrame to delete. |
required |
Source code in datarails/contexts.py
121 122 123 124 125 126 127 128 |
|
get_df(name)
Gets a DataFrame from the DataBox based on its name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the DataFrame to get. |
required |
Returns:
Name | Type | Description |
---|---|---|
DataFrame |
DataFrame
|
The DataFrame associated with the name. |
Source code in datarails/contexts.py
87 88 89 90 91 92 93 94 95 96 97 |
|
pop_df(name)
Pops a DataFrame from the DataBox based on its name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the DataFrame to pop. |
required |
Returns:
Name | Type | Description |
---|---|---|
DataFrame |
DataFrame
|
The DataFrame associated with the name. |
Source code in datarails/contexts.py
109 110 111 112 113 114 115 116 117 118 119 |
|
put_df(name, df)
Puts a DataFrame into the DataBox with a specified name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name to associate with the DataFrame. |
required |
df |
DataFrame
|
The DataFrame to put into the DataBox. |
required |
Source code in datarails/contexts.py
99 100 101 102 103 104 105 106 107 |
|