pandas.Period.day_of_week#
- Period.day_of_week#
Day of the week the period lies in, with Monday=0 and Sunday=6.
The value comes from the last day of the first unit of the period’s frequency, so a
"2M"period uses the last day of its first month.- Returns:
- int
Day of the week.
See also
Period.day_of_weekDay of the week the period lies in.
Period.weekdayAlias of Period.day_of_week.
Period.dayDay of the month.
Period.dayofyearDay of the year.
Period.start_timeGet the Timestamp for the start of the period.
Period.end_timeGet the Timestamp for the end of the period.
Examples
>>> per = pd.Period('2017-12-31 22:00', 'h') >>> per.day_of_week 6
A
"4h"period uses the day of its first hour.>>> per = pd.Period('2017-12-31 22:00', '4h') >>> per.day_of_week 6 >>> per.start_time.day_of_week 6
A monthly period uses its last day.
>>> per = pd.Period('2018-01', 'M') >>> per.day_of_week 2 >>> per.end_time.day_of_week 2