pandas.Series.dt.dayofweek#

Series.dt.dayofweek[source] #

The day of the week with Monday=0, Sunday=6.

Return the day of the week. It is assumed the week starts on Monday, which is denoted by 0 and ends on Sunday which is denoted by 6. This method is available on both Series with datetime values (using the dt accessor) or DatetimeIndex.

Returns:
Series or Index

Containing integers indicating the day number.

See also

Series.dt.dayofweek

Alias.

Series.dt.weekday

Alias.

Series.dt.day_name

Returns 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.dayofweek
2016年12月31日 5
2017年01月01日 6
2017年01月02日 0
2017年01月03日 1
2017年01月04日 2
2017年01月05日 3
2017年01月06日 4
2017年01月07日 5
2017年01月08日 6
Freq: D, dtype: int32