Pandas Series dt.floor() | Round DateTime Values to Nearest Frequency Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report 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 Python3 import pandas as pd sr = pd.Series(['2012-12-31 08:45', '2019-1-1 12:30', '2008-02-2 10:30', '2010-1-1 09:25', '2019-12-31 00:00']) idx = ['Day 1', 'Day 2', 'Day 3', 'Day 4', 'Day 5'] sr.index = idx sr = pd.to_datetime(sr) result = sr.dt.floor(freq = 'D') print(result) Output: SyntaxSyntax: Series.dt.floor(floor) Parameter freq : The frequency level to floor the index toReturns: DatetimeIndex, TimedeltaIndex, or Series How to Round Down DateTime Objects to a Specified FrequencyTo 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. Python3 # importing pandas as pd import pandas as pd # Creating the Series sr = pd.Series(pd.date_range('2012-12-31 09:45', periods = 5, freq = 'T', tz = 'Asia / Calcutta')) # Creating the index idx = ['Day 1', 'Day 2', 'Day 3', 'Day 4', 'Day 5'] # set the index sr.index = idx # Print the series print(sr) Output Python3 # floor to hourly frequency result = sr.dt.floor(freq = 'H') # print the result print(result) Output : 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 More infoAdvertise with us Next Article Pandas Series dt.round | Round Off DateTime Values to Given Frequency S Shubham__Ranjan Follow Improve Article Tags : Pandas Python-pandas Python pandas-series-datetime AI-ML-DS With Python Similar Reads Pandas Series dt.round | Round Off DateTime Values to Given Frequency The Pandas dt.round() method rounds off the DateTime values in a series to a certain frequency level.Example:Python3 import pandas as pd sr = pd.Series(['2012-12-31 08:45', '2019-1-1 12:30', '2008-02-2 10:30', '2010-1-1 09:25', '2019-12-31 00:00']) idx = ['Day 1', 'Day 2', 'Day 3', 'Day 4', 'Day 5'] 2 min read Pandas Series dt.round | Round Off DateTime Values to Given Frequency The Pandas dt.round() method rounds off the DateTime values in a series to a certain frequency level.Example:Python3 import pandas as pd sr = pd.Series(['2012-12-31 08:45', '2019-1-1 12:30', '2008-02-2 10:30', '2010-1-1 09:25', '2019-12-31 00:00']) idx = ['Day 1', 'Day 2', 'Day 3', 'Day 4', 'Day 5'] 2 min read Pandas Series dt.round | Round Off DateTime Values to Given Frequency The Pandas dt.round() method rounds off the DateTime values in a series to a certain frequency level.Example:Python3 import pandas as pd sr = pd.Series(['2012-12-31 08:45', '2019-1-1 12:30', '2008-02-2 10:30', '2010-1-1 09:25', '2019-12-31 00:00']) idx = ['Day 1', 'Day 2', 'Day 3', 'Day 4', 'Day 5'] 2 min read Pandas DataFrame round() Method | Round Values to Decimal Python is a great language for data analysis, primarily because of the fantastic ecosystem of data-centric Python packages. Pandas is one of those packages, making importing and analyzing data much easier. Pandas round() function rounds a DataFrame value to a number with given decimal places. This 2 min read Pandas DataFrame round() Method | Round Values to Decimal Python is a great language for data analysis, primarily because of the fantastic ecosystem of data-centric Python packages. Pandas is one of those packages, making importing and analyzing data much easier. Pandas round() function rounds a DataFrame value to a number with given decimal places. This 2 min read Pandas DataFrame round() Method | Round Values to Decimal Python is a great language for data analysis, primarily because of the fantastic ecosystem of data-centric Python packages. Pandas is one of those packages, making importing and analyzing data much easier. Pandas round() function rounds a DataFrame value to a number with given decimal places. This 2 min read Like