Skip to content

featurebyte.ViewColumn.str.lstrip

lstrip(
to_strip: Optional[str]=None
) -> FrozenSeries

Description

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

Parameters

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

Returns

  • FrozenSeries
    A new Column or Feature object.

Examples

Remove leading "M" characters from the Title column:

>>> view = catalog.get_view("GROCERYCUSTOMER")
>>> view["TitleStrip"] = view["Title"].str.lstrip("M")
>>> view.preview(5).filter(regex="Title")
  Title TitleStrip
0   Ms.         s.
1   Ms.         s.
2   Mr.         r.
3  Mrs.        rs.
4   Mr.         r.