Skip to content

Commit 6d20a36

Browse files
IHackPyjorisvandenbossche
authored andcommitted
DOC : Update the pandas.Period.week docstring (#20331)
1 parent 48e680e commit 6d20a36

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

pandas/_libs/tslibs/period.pyx

+26
Original file line numberDiff line numberDiff line change
@@ -1350,6 +1350,32 @@ cdef class _Period(object):
13501350

13511351
@property
13521352
def week(self):
1353+
"""
1354+
Get the week of the year on the given Period.
1355+
1356+
Returns
1357+
-------
1358+
int
1359+
1360+
See Also
1361+
--------
1362+
Period.dayofweek : Get the day component of the Period.
1363+
Period.weekday : Get the day component of the Period.
1364+
1365+
Examples
1366+
--------
1367+
>>> p = pd.Period("2018-03-11", "H")
1368+
>>> p.week
1369+
10
1370+
1371+
>>> p = pd.Period("2018-02-01", "D")
1372+
>>> p.week
1373+
5
1374+
1375+
>>> p = pd.Period("2018-01-06", "D")
1376+
>>> p.week
1377+
1
1378+
"""
13531379
return self.weekofyear
13541380

13551381
@property

0 commit comments

Comments
 (0)