bigframes.pandas.api.typing.StringMethods.pad#

StringMethods.pad(width, side='left', fillchar=' ') T[source]#

Pad strings in the Series/Index up to width.

Examples:

>>> import bigframes.pandas as bpd
>>> s = bpd.Series(["caribou", "tiger"])
>>> s
0    caribou
1      tiger
dtype: string
>>> s.str.pad(width=10)
0       caribou
1         tiger
dtype: string
>>> s.str.pad(width=10, side='right', fillchar='-')
0    caribou---
1    tiger-----
dtype: string
>>> s.str.pad(width=10, side='both', fillchar='-')
0    -caribou--
1    --tiger---
dtype: string
Parameters:
  • width (int) – Minimum width of resulting string; additional characters will be filled with character defined in fillchar.

  • side ({'left', 'right', 'both'}, default 'left') – Side from which to fill resulting string.

  • fillchar (str, default ' ') – Additional character for filling, default is whitespace.

Returns:

Returns Series or Index with minimum number of char in object.

Return type:

bigframes.series.Series