File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
spec/API_specification/dataframe_api Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -901,3 +901,38 @@ def iso_weekday(self) -> Self:
901
901
"""
902
902
...
903
903
904
+ def floor (self , frequency : str ) -> Column :
905
+ """
906
+ Return floor of each element according to the specified frequency.
907
+
908
+ Flooring is done according to local time. For example,
909
+ for a ``Datetime('us', 'Europe/London')`` column,
910
+ ``"2020-10-25T00:30:00 BST"`` floored by ``"1day"`` gives
911
+ ``"2020-10-25T00:00:00 BST"``.
912
+ Behaviours in the face of ambiguous and non-existent times are
913
+ currently unspecified and may vary across implementations.
914
+
915
+ Flooring by non-fixed durations (e.g. calendar month) are not supported.
916
+ Note that flooring by ``timedelta(days=1)`` is equivalent to flooring
917
+ by ``timedelta(hours=24)``.
918
+
919
+ Parameters
920
+ ----------
921
+ freq : str
922
+ Frequency to floor by. Can be constructed using the following string
923
+ language:
924
+
925
+ - "1day"
926
+ - "1hour"
927
+ - "1minute"
928
+ - "1second"
929
+ - "1millisecond"
930
+ - "1microsecond"
931
+
932
+ Examples
933
+ --------
934
+ Roll each datetime back to the beginning of the day:
935
+
936
+ >>> column: Column
937
+ >>> column.dt.floor("1day")
938
+ """
You can’t perform that action at this time.
0 commit comments