The isoweekday()
function in Pandas returns the day of the week represented by the Timestamp
object, which is the equivalent of Python's DateTime
object.
The isoweekday()
function returns 1
if the day of the week is a Monday, 2
if Tuesday, 3
if Wednesday, and so forth until Sunday, which is represented by 7
.
Timestamp.isoweekday()
The isoweekday()
function takes no parameter value.
The isoweekday()
function returns an int
representing the day of the week.
# A code to illustrate the isoweekday() function in Pandas# Importing the Pandas libraryimport pandas as pd# Creating a Timestamp objecta = pd.Timestamp(2022, 4, 29)# Obtaining the day of the weekprint(a.isoweekday())
pandas
library.Timestamp
object, a
.isoweekday()
function to obtain and print the day of the week from the Timestamp object.Note: The function gives an output value of
5
, which represents that the date2022-04-29
is aFriday.