bigframes.pandas.api.typing.StringMethods.center#

StringMethods.center(width: int, fillchar: str = ' ') T[source]#

Pad left and right side of strings in the Series/Index.

Equivalent to str.center().

Examples:

>>> import bigframes.pandas as bpd
>>> ser = bpd.Series(['dog', 'bird', 'mouse'])
>>> ser.str.center(8, fillchar='.')
0    ..dog...
1    ..bird..
2    .mouse..
dtype: string
Parameters:
  • width (int) – Minimum width of resulting string; additional characters will be filled with character defined in fillchar.

  • 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