Skip to content

featurebyte.Feature.dt.hour

hour: Feature

Description

Returns the hour component of each element. This is also available for Features containing timedelta values, which is a result of taking the difference between two timestamp Features.

Returns

  • Feature
    Feature containing the hour component values

Examples

Compute the hour component of a timestamp column:

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