Skip to content

featurebyte.Target.str.pad

pad(
width: int,
side: Literal["left", "right", "both"]="left",
fillchar: str=" "
) -> Target

Description

Pads each string element up to the specified width.

Parameters

  • width: int
    Minimum width of resulting string. Additional characters will be filled with fillchar.

  • side: Literal["left", "right", "both"]
    default: "left"
    Padding direction.

  • fillchar: str
    default: " "
    Character used to pad.

Returns

  • Target
    A new Target object.

Examples

Pad the ProductGroupLookup target to 10 characters:

>>> target = catalog.get_target("ProductGroupLookup")
>>> target["ProductGroupLookupPadded"] = target.str.pad(10, fillchar="0")