pandas.Period.weekofyear#
- Period.weekofyear#
Get the week of the year on the given Period.
Weeks are numbered according to ISO 8601, where the first week of the year contains the first Thursday of the year.
- Returns:
- int
See also
Period.dayofweekGet the day component of the Period.
Period.weekdayGet the day component of the Period.
Examples
>>> p = pd.Period("2018-03-11", "h") >>> p.weekofyear 10
>>> p = pd.Period("2018-02-01", "D") >>> p.weekofyear 5
>>> p = pd.Period("2018-01-06", "D") >>> p.weekofyear 1