Period.dayofweek
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 the period spans over multiple days, the day at the start of the period is used.
If the frequency is higher than daily (e.g. monthly), the last day of the period is used.
Returns: |
|
---|
See also
Period.dayofweek
Period.weekday
Period.day
Period.dayofyear
>>> per = pd.Period('2017-12-31 22:00', 'H') >>> per.dayofweek 6
For periods that span over multiple days, the day at the beginning of the period is returned.
>>> per = pd.Period('2017-12-31 22:00', '4H') >>> per.dayofweek 6 >>> per.start_time.dayofweek 6
For periods with a frequency higher than days, the last day of the period is returned.
>>> per = pd.Period('2018-01', 'M') >>> per.dayofweek 2 >>> per.end_time.dayofweek 2
© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/0.25.0/reference/api/pandas.Period.dayofweek.html