cudf.core.series.DatetimeProperties.floor#

DatetimeProperties.floor(freq)#

Perform floor operation on the data to the specified freq.

Parameters:
freqstr

One of [“D”, “H”, “T”, “min”, “S”, “L”, “ms”, “U”, “us”, “N”]. Must be a fixed frequency like ‘S’ (second) not ‘ME’ (month end). See frequency aliases for more details on these aliases.

Returns:
Series

Series with all timestamps rounded up to the specified frequency. The index is preserved.

Examples

>>> import cudf
>>> t = cudf.Series(["2001-01-01 00:04:45", "2001-01-01 00:04:58",
... "2001-01-01 00:05:04"], dtype="datetime64[ns]")
>>> t.dt.floor("T")
0   2001-01-01 00:04:00
1   2001-01-01 00:04:00
2   2001-01-01 00:05:00
dtype: datetime64[ns]