cudf.core.series.DatetimeProperties.isocalendar#

DatetimeProperties.isocalendar()[source]#

Returns a DataFrame with the year, week, and day calculated according to the ISO 8601 standard.

Returns:
DataFrame
with columns year, week and day

Examples

>>> ser = cudf.Series(pd.date_range(start="2021-07-25",
... end="2021-07-30"))
>>> ser.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
>>> ser.dt.isocalendar().week
0    29
1    30
2    30
3    30
4    30
5    30
Name: week, dtype: object
>>> serIndex = cudf.to_datetime(pd.Series(["2010-01-01", pd.NaT]))
>>> serIndex.dt.isocalendar()
    year  week  day
0  2009    53     5
1  <NA>  <NA>  <NA>
>>> serIndex.dt.isocalendar().year
0    2009
1    <NA>
Name: year, dtype: object