pandas.DatetimeIndex.day_of_week#
- property DatetimeIndex.day_of_week[source]#
The day of the week with Monday=0, Sunday=6.
Return the day of the week. It is assumed the week starts on Monday, which is denoted by 0 and ends on Sunday which is denoted by 6.
See also
DatetimeIndex.day_of_yearThe ordinal day of the year.
DatetimeIndex.day_nameReturn the name of the day of the week.
Examples
>>> idx = pd.DatetimeIndex(["2016-12-31", "2017-01-01", "2017-01-02"]) >>> idx.day_of_week Index([5, 6, 0], dtype='int32')