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

[FEA] Series datetime quarter #8676

Closed
beckernick opened this issue Jul 7, 2021 · 0 comments · Fixed by #8862
Closed

[FEA] Series datetime quarter #8676

beckernick opened this issue Jul 7, 2021 · 0 comments · Fixed by #8862
Assignees
Labels
feature request New feature or request good first issue Good for newcomers libcudf Affects libcudf (C++/CUDA) code. Python Affects Python cuDF API.

Comments

@beckernick
Copy link
Member

beckernick commented Jul 7, 2021

For feature engineering tasks, I'd like to be able to determine what quarter of the year a date falls into, like I can in pandas. Pandas implements this by extracting the month and doing a few binary ops on it.

import pandas as pds = pd.Series(["2021-02-27", "2021-04-01"], dtype="datetime64[ms]")
s.dt.quarter
0    1
1    2
dtype: int64

This is also a Spark function, so we may want to implement this in libcudf.

@beckernick beckernick added feature request New feature or request Python Affects Python cuDF API. labels Jul 7, 2021
@beckernick beckernick added Cython libcudf Affects libcudf (C++/CUDA) code. labels Jul 7, 2021
@shaneding shaneding self-assigned this Jul 8, 2021
@beckernick beckernick added the good first issue Good for newcomers label Jul 14, 2021
@beckernick beckernick added this to the Time Series Analysis milestone Jul 14, 2021
rapids-bot bot pushed a commit that referenced this issue Jul 26, 2021
Partly addresses #8676.
This PR adds `date_time:: extract_quarter`. The function returns an int `(1,2,3,4)` depending on which quarter of the year the date is in. Also fixed an incorrect date in previous testcase (#8711).

Authors:
  - https://github.com/shaneding

Approvers:
  - Nghia Truong (https://github.com/ttnghia)
  - Conor Hoekstra (https://github.com/codereport)

URL: #8779
rapids-bot bot pushed a commit that referenced this issue Aug 10, 2021
Closes #8676.
This PR adds python bindings for #8779.

Authors:
  - https://github.com/shaneding

Approvers:
  - Michael Wang (https://github.com/isVoid)
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: #8862
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request good first issue Good for newcomers libcudf Affects libcudf (C++/CUDA) code. Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants