- API reference
- pandas arrays, scalars, and data types
- pandas.Perio...
pandas.Period.weekday#
- Period.weekday#
Day of the week the period lies in, with Monday=0 and Sunday=6.
If the period frequency is lower than daily (e.g. hourly), and theperiod spans over multiple days, the day at the start of the period isused.
If the frequency is higher than daily (e.g. monthly), the last dayof the period is used.
- Returns:
- int
Day of the week.
See also
Period.dayofweekDay of the week the period lies in.
Period.weekdayAlias of Period.dayofweek.
Period.dayDay of the month.
Period.dayofyearDay of the year.
Examples
>>>per=pd.Period('2017-12-31 22:00','h')>>>per.dayofweek6
For periods that span over multiple days, the day at the beginning ofthe period is returned.
>>>per=pd.Period('2017-12-31 22:00','4h')>>>per.dayofweek6>>>per.start_time.dayofweek6
For periods with a frequency higher than days, the last day of theperiod is returned.
>>>per=pd.Period('2018-01','M')>>>per.dayofweek2>>>per.end_time.dayofweek2
On this page