tabsdata.tableframe.expr.expr.Expr.alias#
- Expr.alias(name: str) Expr [source]#
Set the name for a column or expression.
- Parameters:
name – Column or expression new name. The name must be a word ([A-Za-z_][A-Za-z0-9_]*) of up to 100 characters.
Example:
>>> import tabsdata as td >>> >>> tf: td.TableFrame ... >>> >>> tf.select(td.col("age"), td.col("age").alias("Age")) >>> ┌──────┬──────┐ │ age ┆ Age │ │ --- ┆ --- │ │ i64 ┆ i64 │ ╞══════╪══════╡ │ 1 ┆ 1 │ │ 15 ┆ 15 │ │ 18 ┆ 18 │ │ 60 ┆ 60 │ │ 60 ┆ 60 │ │ 75 ┆ 75 │ │ null ┆ null │ └──────┴──────┘