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 library import pandas as pd # creating a date time object my_date = pd.Timestamp('2022-04-29T7:48:52.192548651') # obtaining the iso year, week number, and weeekday from the Timestamp print(my_date.isocalendar())
my_date
.my_date
, using the isocalendar()
function.RELATED TAGS
CONTRIBUTOR
View all Courses