Skip to content

featurebyte.ViewColumn.dt.hour

hour: FrozenSeries

Description

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

Returns

  • FrozenSeries
    Column or Feature containing the hour component values

Examples

Compute the hour component of a timestamp column:

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