class_docstr: String methods for pandas-on-Spark Series
class_docstr_tok: ["String","methods","for","pandas-on-Spark","Series"]
docstr: Pad strings in the Series by prepending ‘0’ characters.
  
  Strings in the Series are padded with ‘0’ characters on the left of the
  string to reach a total string length width. Strings in the Series with
  length greater or equal to width are unchanged.
  
  Differs from :func:`str.zfill` which has special handling for ‘+’/’-‘
  in the string.
  
  Parameters
  ----------
  width : int
      Minimum length of resulting string; strings with length less than
      width be prepended with ‘0’ characters.
  
  Returns
  -------
  Series of object
      Series with '0' left-padded strings.
  
  Examples
  --------
  >>> s = ps.Series(['-1', '1', '1000', np.nan])
  >>> s
  0      -1
  1       1
  2    1000
  3    None
  dtype: object
  
  Note that NaN is not a string, therefore it is converted to NaN. The
  minus sign in '-1' is treated as a regular character and the zero is
  added to the left of it (:func:`str.zfill` would have moved it to the
  left). 1000 remains unchanged as it is longer than width.
  
  >>> s.str.zfill(3)  # doctest: +SKIP
  0     -01
  1     001
  2    1000
  3    None
  dtype: object
code: def zfill(self, width: int) -> "ps.Series":
      """
      Pad strings in the Series by prepending ‘0’ characters.
  
      Strings in the Series are padded with ‘0’ characters on the left of the
      string to reach a total string length width. Strings in the Series with
      length greater or equal to width are unchanged.
  
      Differs from :func:`str.zfill` which has special handling for ‘+’/’-‘
      in the string.
  
      Parameters
      ----------
      width : int
          Minimum length of resulting string; strings with length less than
          width be prepended with ‘0’ characters.
  
      Returns
      -------
      Series of object
          Series with '0' left-padded strings.
  
      Examples
      --------
      >>> s = ps.Series(['-1', '1', '1000', np.nan])
      >>> s
      0      -1
      1       1
      2    1000
      3    None
      dtype: object
  
      Note that NaN is not a string, therefore it is converted to NaN. The
      minus sign in '-1' is treated as a regular character and the zero is
      added to the left of it (:func:`str.zfill` would have moved it to the
      left). 1000 remains unchanged as it is longer than width.
  
      >>> s.str.zfill(3)  # doctest: +SKIP
      0     -01
      1     001
      2    1000
      3    None
      dtype: object
      """
  
      def pandas_zfill(s) -> ps.Series[str]:  # type: ignore[no-untyped-def]
          return s.str.zfill(width)
  
      return self._data.pandas_on_spark.transform_batch(pandas_zfill)
  
imports: from typing import Any, Callable, Dict, List, Optional, Union, cast, no_type_check
  import numpy
  import pandas
  from pyspark.sql.types import StringType, BinaryType, ArrayType, LongType, MapType
  from pyspark.sql import functions
  from pyspark.sql.functions import pandas_udf
  import pyspark.pandas
label_desc: Use image node_id 52 for calling the StringMethods obj's underlying member method code with example usage: obj.zfill(width) and returns: self, s