Skip to content

featurebyte.ViewColumn.str.rstrip

rstrip(
to_strip: Union[str, NoneType]=None
) -> FrozenSeries

Description

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

Parameters

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

Returns

  • FrozenSeries
    A new Column or Feature object.

Examples

Remove trailing "M" characters from the Title column:

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