Skip to content

DataFrameColumnExpression

laktory.models.DataFrameColumnExpression ยค

Bases: BaseModel

DataFrame Column Expression supporting SQL statements or string representation of DataFrame API expression.

ATTRIBUTE DESCRIPTION
value

String representation

TYPE: str

type

Expression type: DF or SQL. If None is specified, type is guessed.

TYPE: Literal['SQL', 'DF']

Examples:

from laktory import models

e1 = models.DataFrameColumnExpression(
    value="MAX(close)",
)
print(e1.eval())
# > Column<'MAX(close)'>

e2 = models.DataFrameColumnExpression(
    value="F.abs('close')",
)
print(e2.eval())
# > Column<'abs(close)'>