Skip to content

featurebyte.Feature.str.strip

strip(
to_strip: Union[str, NoneType]=None
) -> Feature

Description

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

Parameters

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

Returns

  • Feature
    A new Feature object.

Examples

Remove leading and trailing "M" characters from the Title column:

>>> feature = catalog.get_feature("ProductGroupLookup")
>>> feature_group = fb.FeatureGroup([feature])
>>> feature_group["ProductGroupStrip"] = feature.str.strip("M")