pandas.PeriodIndex.year#

property PeriodIndex.year[source]#

The year of the period.

Examples

>>> idx = pd.PeriodIndex(["2023", "2024", "2025"], freq="Y")
>>> idx.year
Index([2023, 2024, 2025], dtype='int64')