VOOZH about

URL: https://www.geeksforgeeks.org/pandas/pandas-series-dt-floor/

⇱ Pandas Series dt.floor() | Round DateTime Values to Nearest Frequency - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Pandas Series dt.floor() | Round DateTime Values to Nearest Frequency

Last Updated : 11 Jul, 2025

The dt.floor() method performs floor operation on the data to the specified frequency.

This is useful when we want to round down the DateTime data to a specific frequency level, such as hourly (‘H’), daily (‘D’), monthly (‘M’), etc.

Example

Output:

👁 dt.floor method output

Syntax

Syntax: Series.dt.floor(floor) 

Parameter 

  • freq : The frequency level to floor the index to

Returns: DatetimeIndex, TimedeltaIndex, or Series

How to Round Down DateTime Objects to a Specified Frequency

To round down DateTime objects in Pandas Series to a specified frequency we use the Series.dt.floor method of the Pandas library in Python.

Let us understand it better with an example:

Example:

Use the Series dt.floor() function to floor the DateTime data of the given Series object to the specified frequency.

Output

👁 datetime series created

Output :

👁 datetime data after dt.floor method

As we can see in the output, the Series.dt.floor() function has successfully floored the DateTime values in the given series object to the specified frequency.

Comment

Explore