cudf.core.column.string.StringMethods.rjust#

StringMethods.rjust(width: int, fillchar: str = ' ') SeriesOrIndex#

Filling left side of strings in the Series/Index with an additional character. Equivalent to str.rjust().

Parameters:
widthint

Minimum width of resulting string; additional characters will be filled with fillchar.

fillcharstr, default ‘ ‘ (whitespace)

Additional character for filling, default is whitespace.

Returns:
Series/Index of str dtype

Returns Series or Index.

Examples

>>> import cudf
>>> s = cudf.Series(["hello world", "rapids ai"])
>>> s.str.rjust(20, fillchar="_")
0    _________hello world
1    ___________rapids ai
dtype: object
>>> s = cudf.Series(["a", "",  "ab", "__"])
>>> s.str.rjust(1, fillchar="-")
0     a
1     -
2    ab
3    __
dtype: object