bigframes.pandas.api.typing.StringMethods.zfill#
- StringMethods.zfill(width: int) T[source]#
Pad strings in the Series/Index by prepending ‘0’ characters.
Strings in the Series/Index are padded with ‘0’ characters on the left of the string to reach a total string length width. Strings in the Series/Index with length greater or equal to width are unchanged.
Examples:
>>> import bigframes.pandas as bpd
>>> s = bpd.Series(['-1', '1', '1000', pd.NA]) >>> s 0 -1 1 1 2 1000 3 <NA> dtype: string
>>> s.str.zfill(3) 0 -01 1 001 2 1000 3 <NA> dtype: string
- Parameters:
width (int) – Minimum length of resulting string; strings with length less than width be prepended with ‘0’ characters.
- Returns:
Series of objects.
- Return type: