cudf.DatetimeIndex.year#

property DatetimeIndex.year#

The year of the datetime.

Examples

>>> import cudf
>>> import pandas as pd
>>> datetime_index = cudf.Index(pd.date_range("2000-01-01",
...             periods=3, freq="Y"))
>>> datetime_index
DatetimeIndex(['2000-12-31', '2001-12-31', '2002-12-31'], dtype='datetime64[ns]')
>>> datetime_index.year
Index([2000, 2001, 2002], dtype='int16')