tabsdata.tableframe.expr.string.ExprStringNameSpace.zfill#

ExprStringNameSpace.zfill(length: int | Expr | Series | str) Expr[source]#

Pad numeric string values at the start to the given length using zeros.

Parameters:

length – The length to end pad the string to.

Example:

>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
>>> tf.select(td.col("a"), td.col("a").str.zfill(2).alias("zfill"))
>>>
┌──────┬───────┐
│ a    ┆ zfill │
│ ---  ┆ ---   │
│ str  ┆ str   │
╞══════╪═══════╡
│ 0    ┆ 00    │
│ 1    ┆ 01    │
│ 1000 ┆ 1000  │
│ null ┆ null  │
└──────┴───────┘