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_week

Day of the week the period lies in.

Period.weekday

Alias of Period.day_of_week.

Period.day

Day of the month.

Period.dayofyear

Day of the year.

Period.start_time

Get the Timestamp for the start of the period.

Period.end_time

Get 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