pandas.Series.str.ljust

pandas 3.1.1 · Series and accessors · method

Pad the right-hand side of strings so the text is left-aligned at the desired width.

Call syntax

Series.str.ljust(width, fillchar=' ')

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
width Required
Positional or keyword
int

Set the requested width of the formatted result.

fillchar Optional
Positional or keyword
Default ' '
str

Choose the character used to pad strings.

Returns

Series/Index of objects.