BaseBlock
Bases: ABC
The base class for elements of a Model such as and .
Methods:
Name | Description |
---|---|
estimated_size |
Returns the estimated size of the object in bytes. |
Attributes:
Name | Type | Description |
---|---|---|
data |
DataFrame
|
Returns the object's underlying Polars DataFrame. |
dimensionless |
bool
|
Whether the object has no dimensions. |
dimensions |
list[str] | None
|
The names of the data's dimensions. |
name |
str
|
|
shape |
dict[str, int]
|
The number of distinct labels in each dimension. |
Source code in pyoframe/_model_element.py
data: pl.DataFrame
Returns the object's underlying Polars DataFrame.
dimensionless: bool
Whether the object has no dimensions.
Examples:
A variable with no dimensions
A variable with dimensions of "hour" and "city"
dimensions: list[str] | None
The names of the data's dimensions.
Examples:
A variable with no dimensions
A variable with dimensions of "hour" and "city"
name: str = name
shape: dict[str, int]
The number of distinct labels in each dimension.
Examples:
A variable with no dimensions
A variable with dimensions of "hour" and "city"
estimated_size(unit: pl.SizeUnit = 'b') -> int | float
Returns the estimated size of the object in bytes.
Only considers the size of the underlying DataFrame(s) since other components (e.g., the object name) are negligible.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
unit
|
SizeUnit
|
'b'
|
Examples:
A dimensionless variable contains just a 32 bit (4 bytes) unsigned integer (the variable ID).
A dimensioned variable contains, for every row, a 32 bit ID and, in this case, a 64 bit dim_x
value (1200 bytes total).
Comments