lit
def lit(
value: Any,
dtype: PolarsDataType | None = None,
*,
allow_object: bool = False,
) -> Expr
Categories: generation
Build an expression from a literal (constant) value.
Use it to add or compare against constant values in select /
with_columns / filter.
Parameters
parameter
dtypePolarsDataType | None (DataType | None)Data type for the literal; inferred from value when
omitted.
Examples
tf.with_columns(lit(7).alias("c"))
tf.select(lit(1.5).alias("r"))