Skip to content

Commit a060d1a

Browse files
committed
Update the Period.dayofyear docstring
Signed-off-by: Tushar Mittal <[email protected]>
1 parent fb556ed commit a060d1a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

pandas/_libs/tslibs/period.pyx

+27
Original file line numberDiff line numberDiff line change
@@ -1255,6 +1255,33 @@ cdef class _Period(object):
12551255

12561256
@property
12571257
def dayofyear(self):
1258+
"""
1259+
Return the day of the year.
1260+
1261+
This attribute returns the day of the year on which the particular
1262+
date occurs.
1263+
1264+
Returns
1265+
-------
1266+
int
1267+
The day of year.
1268+
1269+
See Also
1270+
--------
1271+
Period.dayofweek : Return the day of week.
1272+
Period.daysinmonth : Return the days in that month.
1273+
1274+
Examples
1275+
--------
1276+
>>> p = pd.Period("2015-10-23", freq='H')
1277+
>>> p
1278+
Period('2015-10-23 00:00', 'H')
1279+
>>> p.dayofyear
1280+
296
1281+
>>> q = pd.Period("2017-01-01", freq='H')
1282+
>>> q.dayofyear
1283+
1
1284+
"""
12581285
base, mult = get_freq_code(self.freq)
12591286
return pday_of_year(self.ordinal, base)
12601287

0 commit comments

Comments
 (0)