Skip to content

featurebyte.ViewColumn.dt.year

year: FrozenSeries

Description

Returns the year component of each element.

Returns

  • FrozenSeries
    Column or Feature containing the year component values

Examples

Compute the year component of a timestamp column:

>>> view = catalog.get_view("GROCERYINVOICE")
>>> view["TimestampYear"] = view["Timestamp"].dt.year
>>> view.preview(5).filter(regex="Timestamp")
            Timestamp  TimestampYear
0 2022-01-03 12:28:58           2022
1 2022-01-03 16:32:15           2022
2 2022-01-07 16:20:04           2022
3 2022-01-10 16:18:32           2022
4 2022-01-12 17:36:23           2022