str.
pad
Pad strings in the Series up to width.
Minimum width of resulting string; additional characters will be filled with character defined in fillchar.
Side from which to fill resulting string.
Additional character for filling, default is whitespace.
Returns Series with minimum number of char in object.
Examples
>>> s = ps.Series(["caribou", "tiger"]) >>> s 0 caribou 1 tiger dtype: object
>>> s.str.pad(width=10) 0 caribou 1 tiger dtype: object
>>> s.str.pad(width=10, side='right', fillchar='-') 0 caribou--- 1 tiger----- dtype: object
>>> s.str.pad(width=10, side='both', fillchar='-') 0 -caribou-- 1 --tiger--- dtype: object