Skip to content

Commit ed77b5b

Browse files
techytusharjorisvandenbossche
authored andcommitted
DOC: update the Period.dayofyear docstring (#20277)
1 parent 31afaf8 commit ed77b5b

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
@@ -1318,6 +1318,36 @@ cdef class _Period(object):
13181318

13191319
@property
13201320
def dayofyear(self):
1321+
"""
1322+
Return the day of the year.
1323+
1324+
This attribute returns the day of the year on which the particular
1325+
date occurs. The return value ranges between 1 to 365 for regular
1326+
years and 1 to 366 for leap years.
1327+
1328+
Returns
1329+
-------
1330+
int
1331+
The day of year.
1332+
1333+
See Also
1334+
--------
1335+
Period.day : Return the day of the month.
1336+
Period.dayofweek : Return the day of week.
1337+
PeriodIndex.dayofyear : Return the day of year of all indexes.
1338+
1339+
Examples
1340+
--------
1341+
>>> period = pd.Period("2015-10-23", freq='H')
1342+
>>> period.dayofyear
1343+
296
1344+
>>> period = pd.Period("2012-12-31", freq='D')
1345+
>>> period.dayofyear
1346+
366
1347+
>>> period = pd.Period("2013-01-01", freq='D')
1348+
>>> period.dayofyear
1349+
1
1350+
"""
13211351
base, mult = get_freq_code(self.freq)
13221352
return pday_of_year(self.ordinal, base)
13231353

0 commit comments

Comments
 (0)