Expr.str.pad_end
methodView source ↗
def pad_end(length: int, fill_char: str = ' ') -> Expr
Categories: string
Pad string values at the end to the given length using the given fill character.
Parameters
parameter
lengthThe length to end 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_end(6, "-").alias("pad_end"))
>>>
┌────────┬─────────┐
│ a ┆ pad_end │
│ --- ┆ --- │
│ str ┆ str │
╞════════╪═════════╡
│ abc ┆ abc--- │
│ def ┆ def │
│ null ┆ null │
└────────┴─────────┘