Skip to content

featurebyte.Target.str.strip

strip(
to_strip: Optional[str]=None
) -> Target

Description

Removes leading and trailing characters (whitespaces by default) from each string element.

Parameters

  • to_strip: Optional[str]
    Characters to remove, whitespace is used by default.

Returns

  • Target
    A new Target object.

Examples

Remove leading and trailing "M" characters from the ProductGroupLookup target:

>>> target = catalog.get_target("ProductGroupLookup")
>>> target["ProductGroupStrip"] = target.str.strip("M")