pandas.Timestamp.isocalendar#

Timestamp.isocalendar()#

Return a named tuple containing ISO year, week number, and weekday.

The ISO 8601 calendar is a widely used international standard. The returned named tuple has three components: year, week, and weekday. The ISO year may differ from the Gregorian year for dates near the start or end of a calendar year.

See also

DatetimeIndex.isocalendar

Return a 3-tuple containing ISO year, week number, and weekday for the given DatetimeIndex object.

datetime.date.isocalendar

The equivalent method for datetime.date objects.

Examples

>>> ts = pd.Timestamp('2023-01-01 10:00:00')
>>> ts
Timestamp('2023-01-01 10:00:00')
>>> ts.isocalendar()
datetime.IsoCalendarDate(year=2022, week=52, weekday=7)