Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions pandas/_libs/tslibs/period.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,32 @@ cdef class _Period(object):

@property
def week(self):
"""
Get the week of the year on the given Period.

Returns
-------
int

See Also
--------
Period.dayofweek : Get the day component of the Period.
Period.weekday : Get the day component of the Period.

Examples
--------
>>> p = pd.Period("2018-03-11", "H")
>>> p.week
10

>>> p = pd.Period("2018-02-01", "D")
>>> p.week
5

>>> p = pd.Period("2018-01-06", "D")
>>> p.week
1
"""
return self.weekofyear

@property
Expand Down