Expr.str.pad_start
methodView source ↗
def pad_start(length: int, fill_char: str = ' ') -> Expr
Categories: string
Pad string values at the front to the given length using the given fill character.
Parameters
parameter
lengthThe length to front pad the string to.
parameter
fill_charThe character to use for padding.
Examples
>>> 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 │
└────────┴───────────┘