Skip to content

temporian.EventSet.calendar_day_of_week #

    tz: Union[str, float, int] = 0
) -> EventSetOrNode

Obtains the day of the week the timestamps in an EventSet's sampling are in.

Features in the input are ignored, only the timestamps are used and they must be unix timestamps (is_unix_timestamp=True).

Output feature contains numbers from 0 (Monday) to 6 (Sunday).

By default, the timezone is UTC unless the tz argument is specified, as an offset in hours or a timezone name. See EventSet.calendar_hour() for an example using timezones.

Usage example
>>> a = tp.event_set(
...    timestamps=["2023-06-19", "2023-06-21", "2023-06-25", "2023-07-03"],
... )
>>> b = a.calendar_day_of_week()
>>> b
indexes: ...
features: [('calendar_day_of_week', int32)]
    (4 events):
        timestamps: [...]
        'calendar_day_of_week': [0  2  6  0]


Name Type Description Default
tz Union[str, float, int]

timezone name (see pytz.all_timezones) or UTC offset in hours.



Type Description

EventSet with a single feature with the day of the week each timestamp in sampling belongs to.