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 isocalendar #8896

Closed
beckernick opened this issue Jul 29, 2021 · 1 comment · Fixed by #9169
Closed

[FEA] Series datetime isocalendar #8896

beckernick opened this issue Jul 29, 2021 · 1 comment · Fixed by #9169
Assignees
Labels
feature request New feature or request Python Affects Python cuDF API.

Comments

@beckernick
Copy link
Member

As noted in #4908 , pandas plans to eventually deprecate series.dt.week and series.dt.weekofyear in favor of series.dt.isocalendar().week. The isocalendar() method returns a DataFrame containing the ISO 8601 year, week of year (number), and day of week (1-7, rather than 0-6 like series.dt.dayofweek).

It also exists on the Timestamp class, on which it returns a tuple of the three values. This use case is generally less common.

This feature should probably come after #4908 , as weekofyear | week were marked for deprecation in pandas 1.1 but are still alive and kicking in 1.3.

import pandas as pds = pd.Series(pd.date_range(start="2021-07-25", end="2021-07-30"))
print(s.dt.isocalendar())
   year  week  day
0  2021    29    7
1  2021    30    1
2  2021    30    2
3  2021    30    3
4  2021    30    4
5  2021    30    5
import pandas as pd
pd.Timestamp("2021-07-01").isocalendar()
(2021, 26, 4)
@beckernick beckernick added feature request New feature or request Python Affects Python cuDF API. labels Jul 29, 2021
@beckernick beckernick added this to the Time Series Analysis milestone Jul 29, 2021
@marlenezw marlenezw self-assigned this Aug 3, 2021
@marlenezw
Copy link
Contributor

This issue should be pretty easily solved once #9047 is merged! Looks like it's still waiting on reviews.

rapids-bot bot pushed a commit that referenced this issue Sep 30, 2021
Closes #8896 #4908.

 It creates a new `isocalendar` method in cudf python, and solves related datetime issues for obtaining week, year and day in isocalendar form.

Authors:
  - Marlene  (https://github.com/marlenezw)
  - GALI PREM SAGAR (https://github.com/galipremsagar)

Approvers:
  - Ram (Ramakrishna Prabhu) (https://github.com/rgsl888prabhu)
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: #9169
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 Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants