Skip to content

Commit e995b0d

Browse files
hammadmashkoorjorisvandenbossche
authored andcommitted
DOC: update the Period.dayofweek attribute docstring (#20280)
1 parent 8a26afe commit e995b0d

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Diff for: pandas/_libs/tslibs/period.pyx

+31
Original file line numberDiff line numberDiff line change
@@ -1309,6 +1309,37 @@ cdef class _Period(object):
13091309

13101310
@property
13111311
def dayofweek(self):
1312+
"""
1313+
Return the day of the week.
1314+
1315+
This attribute returns the day of the week on which the particular
1316+
date for the given period occurs depending on the frequency with
1317+
Monday=0, Sunday=6.
1318+
1319+
Returns
1320+
-------
1321+
Int
1322+
Range from 0 to 6 (included).
1323+
1324+
See also
1325+
--------
1326+
Period.dayofyear : Return the day of the year.
1327+
Period.daysinmonth : Return the number of days in that month.
1328+
1329+
Examples
1330+
--------
1331+
>>> period1 = pd.Period('2012-1-1 19:00', freq='H')
1332+
>>> period1
1333+
Period('2012-01-01 19:00', 'H')
1334+
>>> period1.dayofweek
1335+
6
1336+
1337+
>>> period2 = pd.Period('2013-1-9 11:00', freq='H')
1338+
>>> period2
1339+
Period('2013-01-09 11:00', 'H')
1340+
>>> period2.dayofweek
1341+
2
1342+
"""
13121343
base, mult = get_freq_code(self.freq)
13131344
return pweekday(self.ordinal, base)
13141345

0 commit comments

Comments
 (0)