pyspark.pandas.Series.str.rstrip#
- str.rstrip(to_strip=None)#
Remove trailing characters.
Strip whitespaces (including newlines) or a set of specified characters from each string in the Series/Index from right side. Equivalent to
str.rstrip()
.- Parameters
- to_stripstr
Specifying the set of characters to be removed. All combinations of this set of characters will be stripped. If None then whitespaces are removed.
- Returns
- Series of object
Examples
>>> s = ps.Series(['1. Ant.', '2. Bee!\t', None]) >>> s 0 1. Ant. 1 2. Bee!\t 2 None dtype: object
>>> s.str.rstrip('.!\t') 0 1. Ant 1 2. Bee 2 None dtype: object