Skip to content

Commit 7ef072f

Browse files
DOC: Fix GL08 for pandas.tseries.offsets.CDay
1 parent 9648bc0 commit 7ef072f

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

doc/source/reference/offset_frequency.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ Properties
159159
CustomBusinessDay.weekmask
160160
CustomBusinessDay.calendar
161161
CustomBusinessDay.holidays
162+
CustomBusinessDay.offset
162163

163164
Methods
164165
~~~~~~~

pandas/_libs/tslibs/offsets.pyx

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2123,7 +2123,32 @@ cdef class BusinessMixin(SingleConstructorOffset):
21232123
@property
21242124
def offset(self):
21252125
"""
2126-
Alias for self._offset.
2126+
Return the time offset applied to the business day.
2127+
2128+
This property returns the timedelta that is added to the result
2129+
after calculating the business day offset. It allows shifting
2130+
the resulting timestamp by a fixed time duration.
2131+
2132+
Returns
2133+
-------
2134+
timedelta
2135+
The time offset applied after business day calculation.
2136+
2137+
See Also
2138+
--------
2139+
BusinessDay : Standard business day offset.
2140+
CustomBusinessDay : Custom business day offset with configurable parameters.
2141+
2142+
Examples
2143+
--------
2144+
>>> import datetime as dt
2145+
>>> cbd = pd.offsets.CustomBusinessDay()
2146+
>>> cbd.offset
2147+
datetime.timedelta(0)
2148+
2149+
>>> cbd_with_offset = pd.offsets.CustomBusinessDay(offset=dt.timedelta(hours=9))
2150+
>>> cbd_with_offset.offset
2151+
datetime.timedelta(seconds=32400)
21272152
"""
21282153
# Alias for backward compat
21292154
return self._offset

0 commit comments

Comments
 (0)