modin.pandas.DatetimeIndex.year

property DatetimeIndex.year: Index[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.26.0/snowpark-python/src/snowflake/snowpark/modin/plugin/extensions/datetime_index.py#L269-L286)

The year of the datetime.

Return type:

An Index with the year of the datetime.

Examples

>>> idx = pd.date_range("2000-01-01", periods=3, freq="YE")
>>> idx
DatetimeIndex(['2000-12-31', '2001-12-31', '2002-12-31'], dtype='datetime64[ns]', freq=None)
>>> idx.year
Index([2000, 2001, 2002], dtype='int64')
Copy
Language: English