DataRailsContext
To use this class
from datarails.contexts import DataRailsContext
Bases: _BaseContext
DataRailsContext provides an interface to interact with its data.
Source code in datarails/contexts.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|
__str__()
Returns a string representation of the context.
Source code in datarails/contexts.py
32 33 34 |
|
delete(name)
Deletes a value from the context based on its name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the value to delete. |
required |
Source code in datarails/contexts.py
70 71 72 73 74 75 76 77 |
|
get(name)
Gets a value from the context based on its name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the value to get. |
required |
Returns:
Type | Description |
---|---|
Union[Any, None]
|
Union[Any, None]: The value associated with the name, or None if it doesn't exist. |
Source code in datarails/contexts.py
36 37 38 39 40 41 42 43 44 45 46 |
|
pop(name)
Pops a value from the context based on its name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the value to pop. |
required |
Returns:
Name | Type | Description |
---|---|---|
DataFrame |
DataFrame
|
The DataFrame associated with the name. |
Source code in datarails/contexts.py
58 59 60 61 62 63 64 65 66 67 68 |
|
put(name, value)
Puts a value into the context with a specified name.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name to associate with the value. |
required |
value |
Any
|
The value to put into the context. |
required |
Source code in datarails/contexts.py
48 49 50 51 52 53 54 55 56 |
|