class_docstr: Date/Time methods for pandas-on-Spark Series
class_docstr_tok: ["Date\/Time","methods","for","pandas-on-Spark","Series"]
docstr: Perform floor operation on the data to the specified freq.
  
  Parameters
  ----------
  freq : str or Offset
      The frequency level to floor the index to. Must be a fixed
      frequency like 'S' (second) not 'ME' (month end).
  
  nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, default 'raise'
      A nonexistent time does not exist in a particular timezone
      where clocks moved forward due to DST.
  
      - 'shift_forward' will shift the nonexistent time forward to the
        closest existing time
      - 'shift_backward' will shift the nonexistent time backward to the
        closest existing time
      - 'NaT' will return NaT where there are nonexistent times
      - timedelta objects will shift nonexistent times by the timedelta
      - 'raise' will raise an NonExistentTimeError if there are
        nonexistent times
  
      .. note:: this option only works with pandas 0.24.0+
  
  Returns
  -------
  Series
      a Series with the same index for a Series.
  
  Raises
  ------
  ValueError if the `freq` cannot be converted.
  
  Examples
  --------
  >>> series = ps.Series(pd.date_range('1/1/2018 11:59:00', periods=3, freq='min'))
  >>> series
  0   2018-01-01 11:59:00
  1   2018-01-01 12:00:00
  2   2018-01-01 12:01:00
  dtype: datetime64[ns]
  
  >>> series.dt.floor("H")
  0   2018-01-01 11:00:00
  1   2018-01-01 12:00:00
  2   2018-01-01 12:00:00
  dtype: datetime64[ns]
docstr_tok: ["Perform","floor","operation","on","the","data","to","the","specified","freq",".","Parameters","--","--","--","--","--","freq",":","str","or","Offset","The","frequency","level","to","floor","the","index","to",".","Must","be","a","fixed","frequency","like","'S","'","(","second",")","not","'ME","'","(","month","end",")",".","nonexistent",":","'shift_forward","'",",","'shift_backward",",","'NaT","'",",","timedelta",",","default","'raise'","A","nonexistent","time","does","not","exist","in","a","particular","timezone","where","clocks","moved","forward","due","to","DST",".","-","'shift_forward","'","will","shift","the","nonexistent","time","forward","to","the","closest","existing","time","-","'shift_backward","'","will","shift","the","nonexistent","time","backward","to","the","closest","existing","time","-","'NaT","'","will","return","NaT","where","there","are","nonexistent","times","-","timedelta","objects","will","shift","nonexistent","times","by","the","timedelta","-","'raise","'","will","raise","an","NonExistentTimeError","if","there","are","nonexistent","times","..","note",":",":","this","option","only","works","with","pandas","0.24.0+","Returns","--","--","--","-","Series","a","Series","with","the","same","index","for","a","Series",".","Raises","--","--","--","ValueError","if","the","`","freq","`","can","not","be","converted",".","Examples","--","--","--","--",">",">",">","series","=","ps.Series","(","pd.date_range","(","'","1\/1\/2018","11:59:00","'",",","periods=3",",","freq='min","'",")",")",">",">",">","series","0","2018-01-01","11:59:00","1","2018-01-01","12:00:00","2","2018-01-01","12:01:00","dtype",":","datetime64","[","ns","]",">",">",">","series.dt.floor","(","``","H","''",")","0","2018-01-01","11:00:00","1","2018-01-01","12:00:00","2","2018-01-01","12:00:00","dtype",":","datetime64","[","ns","]"]
code: def floor(
      self, freq: Union[str, DateOffset], *args: Any, **kwargs: Any
  ) -> "ps.Series":
      """
      Perform floor operation on the data to the specified freq.
  
      Parameters
      ----------
      freq : str or Offset
          The frequency level to floor the index to. Must be a fixed
          frequency like 'S' (second) not 'ME' (month end).
  
      nonexistent : 'shift_forward', 'shift_backward, 'NaT', timedelta, default 'raise'
          A nonexistent time does not exist in a particular timezone
          where clocks moved forward due to DST.
  
          - 'shift_forward' will shift the nonexistent time forward to the
            closest existing time
          - 'shift_backward' will shift the nonexistent time backward to the
            closest existing time
          - 'NaT' will return NaT where there are nonexistent times
          - timedelta objects will shift nonexistent times by the timedelta
          - 'raise' will raise an NonExistentTimeError if there are
            nonexistent times
  
          .. note:: this option only works with pandas 0.24.0+
  
      Returns
      -------
      Series
          a Series with the same index for a Series.
  
      Raises
      ------
      ValueError if the `freq` cannot be converted.
  
      Examples
      --------
      >>> series = ps.Series(pd.date_range('1/1/2018 11:59:00', periods=3, freq='min'))
      >>> series
      0   2018-01-01 11:59:00
      1   2018-01-01 12:00:00
      2   2018-01-01 12:01:00
      dtype: datetime64[ns]
  
      >>> series.dt.floor("H")
      0   2018-01-01 11:00:00
      1   2018-01-01 12:00:00
      2   2018-01-01 12:00:00
      dtype: datetime64[ns]
      """
  
      def pandas_floor(s) -> ps.Series[np.datetime64]:  # type: ignore[no-untyped-def]
          return s.dt.floor(freq, *args, **kwargs)
  
      return self._data.pandas_on_spark.transform_batch(pandas_floor)
  
imports: from typing import Any, Optional, Union, no_type_check
  import numpy
  import pandas
  from pandas.tseries.offsets import DateOffset
  import pyspark.pandas
  import pyspark.sql.functions
  from pyspark.sql.types import DateType, TimestampType, TimestampNTZType, IntegerType
  from pyspark.pandas import DataFrame
  from pyspark.pandas.config import option_context
label_desc: Use image node_id 32 for calling the DatetimeMethods obj's underlying member method code with example usage: obj.floor(freq) and returns: self, s