Skip to content

featurebyte.Feature.dt.year

year: Feature

Description

Returns the year component of each element.

Returns

  • Feature
    Feature containing the year component values

Examples

Compute the year component of a timestamp column:

>>> feature = catalog.get_feature("CustomerLatestInvoiceTimestamp")
>>> feature_group = fb.FeatureGroup([feature])
>>> feature_group["TimestampYear"] = feature.dt.year