-
Notifications
You must be signed in to change notification settings - Fork 920
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dayofyear and day_of_year to Series, DatetimeColumn, and Datetime…
…Index (#8626) This PR: - [x] Adds `[Series/DatetimeColumn/DatetimeIndex].dt.dayofyear` and `day_of_year` - [x] Updates the existing pytests to include dayofyear/day_of_year - [x] Includes docstrings in new methods ```python import cudf import pandas as pd s = pd.Series(["2021-01-08", "2021-06-28", "2020-03-09", "2021-06-30"], dtype="datetime64[ms]") s = s.repeat(25000) # 100K elements gs = cudf.from_pandas(s) %timeit gs.dt.dayofyear %timeit s.dt.dayofyear 39 µs ± 169 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each) 6.49 ms ± 39.1 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) ``` This closes #8625 Authors: - Nick Becker (https://github.com/beckernick) Approvers: - GALI PREM SAGAR (https://github.com/galipremsagar) URL: #8626
- Loading branch information
1 parent
0e2a448
commit 7f2cc4c
Showing
6 changed files
with
131 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,6 +82,8 @@ def numerical_data(): | |
"second", | ||
"weekday", | ||
"dayofweek", | ||
"dayofyear", | ||
"day_of_year", | ||
] | ||
|
||
|
||
|