- API reference
- pandas.DatetimeIndex
- pandas.Datet...
pandas.DatetimeIndex.weekday#
- propertyDatetimeIndex.weekday[source]#
The day of the week with Monday=0, Sunday=6.
Return the day of the week. It is assumed the week starts onMonday, which is denoted by 0 and ends on Sunday which is denotedby 6. This method is available on both Series with datetimevalues (using thedt accessor) or DatetimeIndex.
- Returns:
- Series or Index
Containing integers indicating the day number.
See also
Series.dt.dayofweekAlias.
Series.dt.weekdayAlias.
Series.dt.day_nameReturns the name of the day of the week.
Examples
>>>s=pd.date_range('2016-12-31','2017-01-08',freq='D').to_series()>>>s.dt.dayofweek2016-12-31 52017-01-01 62017-01-02 02017-01-03 12017-01-04 22017-01-05 32017-01-06 42017-01-07 52017-01-08 6Freq: D, dtype: int32
On this page