Series.dt
can be used to access series values as datetimelike and return multiple properties. Series.dt.dayofweek
Pandas Series.dt.dayofweek
returns the day of the week. The week is assumed to start on Monday, which is 0 and ends on Sunday, which is 6.
Syntax: Series.dt.dayofweek
Parameter: None
Returns: numpy array
Example # 1: Use the Series.dt.dayofweek
attribute to return the day of the week for a given datetime in the underlying data of this Series object.

Output:
We will now use the Series.dt.dayofweek
attribute to return the day of the week for a given date and time in the underlying data of this Series object .

Output:
As we can see from the output, the attribute is Series.dt.dayofweek
successfully accessed and returned the day of the week in the underlying data of this series object.
Example # 2: Use the Series.dt.dayofweek
attribute to return the day of the week for a given datetime in the underlying data of a given Series object.

Output:
Now we will use the attribute Series.dt.dayofweek
to return the day of the week for a given date and time in the underlying data of this Series object.
# print the result 
Output:
As we can see from the output, the Series.dt.dayofweek
successfully accessed and returned the day of the week in the underlying data of this series object.
Executing Data Quality Projects: Ten Steps to Quality Data and Trusted Information (TM), 2nd Edition. Execute Data Quality Projects, Second Edition presents a structured yet flexible approach to cr...
28/08/2021
We are experiencing a renaissance of artificial intelligence, and everyone and their neighbor wants to be a part of this movement. That’s quite likely why you are browsing through this book. There a...
23/09/2020
Mark Lutz is the global leader in Python training, author of the oldest and bestselling Python texts, and a pioneer in the Python community since 1992.
Mark Lutz is the author of the found...
11/08/2021
During 2014, 2015, and 2016, surveys show that among all software developers, those with higher wages are the data engineers, the data scientists, and the data architects. This is because there is ...
10/07/2020