Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dayofyear and day_of_year to Series, DatetimeColumn, and DatetimeIndex #8626

Merged
merged 3 commits into from
Jun 30, 2021
Merged

Add dayofyear and day_of_year to Series, DatetimeColumn, and DatetimeIndex #8626

merged 3 commits into from
Jun 30, 2021

Conversation

beckernick
Copy link
Member

@beckernick beckernick commented Jun 29, 2021

This PR:

  • Adds [Series/DatetimeColumn/DatetimeIndex].dt.dayofyear and day_of_year
  • Updates the existing pytests to include dayofyear/day_of_year
  • Includes docstrings in new methods
import cudf
import pandas as pds = 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

@beckernick beckernick requested a review from a team as a code owner June 29, 2021 15:24
@github-actions github-actions bot added the Python Affects Python cuDF API. label Jun 29, 2021
@beckernick beckernick added feature request New feature or request non-breaking Non-breaking change labels Jun 29, 2021
@beckernick beckernick self-assigned this Jun 29, 2021
@beckernick
Copy link
Member Author

rerun tests

@galipremsagar
Copy link
Contributor

rerun tests

@galipremsagar galipremsagar added the 5 - Ready to Merge Testing and reviews complete, ready to merge label Jun 30, 2021
@codecov
Copy link

codecov bot commented Jun 30, 2021

Codecov Report

❗ No coverage uploaded for pull request base (branch-21.08@9510ef6). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##             branch-21.08    #8626   +/-   ##
===============================================
  Coverage                ?   10.62%           
===============================================
  Files                   ?      109           
  Lines                   ?    18627           
  Branches                ?        0           
===============================================
  Hits                    ?     1980           
  Misses                  ?    16647           
  Partials                ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9510ef6...4246a01. Read the comment docs.

@galipremsagar
Copy link
Contributor

@gpucibot merge

@rapids-bot rapids-bot bot merged commit 7f2cc4c into rapidsai:branch-21.08 Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge feature request New feature or request non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] Series dayofyear / day_of_year
2 participants