Skip to content

Commit d3691ea

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

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

pandas/_libs/tslibs/period.pyx

+30
Original file line numberDiff line numberDiff line change
@@ -1255,6 +1255,36 @@ 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. The return value ranges between 1 to 365 for regular
1263+
years and 1 to 366 for leap years.
1264+
1265+
Returns
1266+
-------
1267+
int
1268+
The day of year.
1269+
1270+
See Also
1271+
--------
1272+
Period.dayofweek : Return the day of week.
1273+
Period.daysinmonth : Return the days in that month.
1274+
PeriodIndex.dayofyear : Return the day of year of all indexes.
1275+
1276+
Examples
1277+
--------
1278+
>>> period = pd.Period("2015-10-23", freq='H')
1279+
>>> period.dayofyear
1280+
296
1281+
>>> period = pd.Period("2012-12-31", freq='D')
1282+
>>> period.dayofyear
1283+
366
1284+
>>> period = pd.Period("2013-01-01", freq='D')
1285+
>>> period.dayofyear
1286+
1
1287+
"""
12581288
base, mult = get_freq_code(self.freq)
12591289
return pday_of_year(self.ordinal, base)
12601290

0 commit comments

Comments
 (0)