class_docstr: String methods for pandas-on-Spark Series
class_docstr_tok: ["String","methods","for","pandas-on-Spark","Series"]
docstr: Slice substrings from each element in the Series.
  
  Parameters
  ----------
  start : int, optional
      Start position for slice operation.
  stop : int, optional
      Stop position for slice operation.
  step : int, optional
      Step size for slice operation.
  
  Returns
  -------
  Series of object
      Series from sliced substrings from original string objects.
  
  Examples
  --------
  >>> s = ps.Series(["koala", "fox", "chameleon"])
  >>> s
  0        koala
  1          fox
  2    chameleon
  dtype: object
  
  >>> s.str.slice(start=1)
  0        oala
  1          ox
  2    hameleon
  dtype: object
  
  >>> s.str.slice(stop=2)
  0    ko
  1    fo
  2    ch
  dtype: object
  
  >>> s.str.slice(step=2)
  0      kaa
  1       fx
  2    caeen
  dtype: object
  
  >>> s.str.slice(start=0, stop=5, step=3)
  0    kl
  1     f
  2    cm
  dtype: object
code: def slice(
      self,
      start: Optional[int] = None,
      stop: Optional[int] = None,
      step: Optional[int] = None,
  ) -> "ps.Series":
      """
      Slice substrings from each element in the Series.
  
      Parameters
      ----------
      start : int, optional
          Start position for slice operation.
      stop : int, optional
          Stop position for slice operation.
      step : int, optional
          Step size for slice operation.
  
      Returns
      -------
      Series of object
          Series from sliced substrings from original string objects.
  
      Examples
      --------
      >>> s = ps.Series(["koala", "fox", "chameleon"])
      >>> s
      0        koala
      1          fox
      2    chameleon
      dtype: object
  
      >>> s.str.slice(start=1)
      0        oala
      1          ox
      2    hameleon
      dtype: object
  
      >>> s.str.slice(stop=2)
      0    ko
      1    fo
      2    ch
      dtype: object
  
      >>> s.str.slice(step=2)
      0      kaa
      1       fx
      2    caeen
      dtype: object
  
      >>> s.str.slice(start=0, stop=5, step=3)
      0    kl
      1     f
      2    cm
      dtype: object
      """
  
      def pandas_slice(s) -> ps.Series[str]:  # type: ignore[no-untyped-def]
          return s.str.slice(start, stop, step)
  
      return self._data.pandas_on_spark.transform_batch(pandas_slice)
  
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 46 for calling the StringMethods obj's underlying member method code with example usage: obj.slice(start, stop, step) and returns: self, s