pandas.PeriodIndex.year — pandas 2.2.3 documentation (original) (raw)

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')