Skip to content

LazyColumn.dt.year

year property

year: LazyColumn

Extracts the year component from each datetime value.

Returns:

Name Type Description
LazyColumn LazyColumn

A new LazyColumn of integer values representing the year.

Examples:

print(df.head())
#              my_datetime_column
# 0  2023-01-01 00:00:00
# 1  2024-05-10 15:30:00
# 2  2025-12-31 23:59:59

df["my_datetime_column"].dt.year
# [2023, 2024, 2025, ...]