Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
"$BASE_DIR"/scripts/validate_docstrings.py \
--format=actions \
-i ES01 `# For now it is ok if docstrings are missing the extended summary` \
-i "pandas.tseries.offsets.BDay PR02,SA01" \
-i "pandas.tseries.offsets.BusinessDay PR02,SA01" \
-i "pandas.tseries.offsets.BusinessHour PR02,SA01" \
-i "pandas.tseries.offsets.CDay PR02,SA01" \
-i "pandas.tseries.offsets.CustomBusinessDay PR02,SA01" \
Expand Down
1 change: 1 addition & 0 deletions doc/source/reference/offset_frequency.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Properties
BusinessDay.normalize
BusinessDay.rule_code
BusinessDay.n
BusinessDay.offset
BusinessDay.weekmask
BusinessDay.holidays
BusinessDay.calendar
Expand Down
37 changes: 35 additions & 2 deletions pandas/_libs/tslibs/offsets.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2123,7 +2123,32 @@ cdef class BusinessMixin(SingleConstructorOffset):
@property
def offset(self):
"""
Alias for self._offset.
Return the time offset applied to the business day.

This property returns the timedelta offset that is added to the
business day calculation result. It allows for shifting the result
by a fixed time amount.

Returns
-------
timedelta
The time offset applied to the business day.

See Also
--------
BusinessDay : Represents a single business day offset.
CustomBusinessDay : Custom business day offset with configurable weekmask.

Examples
--------
>>> bd = pd.offsets.BusinessDay()
>>> bd.offset
datetime.timedelta(0)

>>> import datetime as dt
>>> bd = pd.offsets.BusinessDay(offset=dt.timedelta(hours=2))
>>> bd.offset
datetime.timedelta(seconds=7200)
"""
# Alias for backward compat
return self._offset
Expand Down Expand Up @@ -2335,7 +2360,11 @@ cdef class BusinessDay(BusinessMixin):
"""
DateOffset subclass representing possibly n business days.

Parameters
BusinessDay, also known as BDay, is a date offset representing a single
business day or a number of business days. Business days exclude weekends
(Saturday and Sunday) by default.

Attributes
----------
n : int, default 1
The number of days represented.
Expand All @@ -2344,6 +2373,10 @@ cdef class BusinessDay(BusinessMixin):
offset : timedelta, default timedelta(0)
Time offset to apply.

See Also
--------
:class:`~pandas.tseries.offsets.DateOffset` : Standard kind of date increment.

Examples
--------
You can use the parameter ``n`` to represent a shift of n business days.
Expand Down
Loading