tabsdata.tableframe.expr.string.ExprStringNameSpace.pad_start#

ExprStringNameSpace.pad_start(length: int, fill_char: str = ' ') Expr[source]#

Pad string values at the front to the given length using the given fill character.

Parameters:
  • length – The length to front pad the string to.

  • fill_char – The character to use for padding.

Example:

>>> import tabsdata as td
>>>
>>> tf: td.TableFrame ...
>>>
>>> tf.select(td.col("a"), td.col("a").str.pad_start(6, "-").alias("pad_start"))
>>>
┌────────┬───────────┐
│ a      ┆ pad_start │
│ ---    ┆ ---       │
│ str    ┆ str       │
╞════════╪═══════════╡
│ abc    ┆ ---abc    │
│    def ┆    def    │
│ null   ┆ null      │
└────────┴───────────┘