The isocalendar() function in Pandas returns the ISO year, week number, and weekday from a Timestamp object (an equivalent of Python's datetime object).
The isocalendar() function takes the following syntax:
Timestamp.isocalendar()
The isocalendar() function takes no parameter value.
The isocalendar() function returns a 3-tuple holding the results.
# A code to illustrate the isocalendar() function in Pandas# importing the pandas libraryimport pandas as pd# creating a date time objectmy_date = pd.Timestamp('2022-04-29T7:48:52.192548651')# obtaining the iso year, week number, and weeekday from the Timestampprint(my_date.isocalendar())
my_date.my_date, using the isocalendar() function.