Skip to content

DOC: Update import statement #45485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 21, 2022
Merged
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
16 changes: 9 additions & 7 deletions pandas/tseries/holiday.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,35 +177,37 @@ class from pandas.tseries.offsets

Examples
--------
>>> from pandas.tseries.holiday import Holiday, nearest_workday
>>> from dateutil.relativedelta import MO

>>> USMemorialDay = Holiday(
>>> USMemorialDay = pd.tseries.holiday.Holiday(
... "Memorial Day", month=5, day=31, offset=pd.DateOffset(weekday=MO(-1))
... )
>>> USMemorialDay
Holiday: Memorial Day (month=5, day=31, offset=<DateOffset: weekday=MO(-1)>)

>>> USLaborDay = Holiday(
>>> USLaborDay = pd.tseries.holiday.Holiday(
... "Labor Day", month=9, day=1, offset=pd.DateOffset(weekday=MO(1))
... )
>>> USLaborDay
Holiday: Labor Day (month=9, day=1, offset=<DateOffset: weekday=MO(+1)>)

>>> July3rd = Holiday("July 3rd", month=7, day=3)
>>> July3rd = pd.tseries.holiday.Holiday("July 3rd", month=7, day=3)
>>> July3rd
Holiday: July 3rd (month=7, day=3, )

>>> NewYears = Holiday(
>>> NewYears = pd.tseries.holiday.Holiday(
... "New Years Day", month=1, day=1,
... observance=nearest_workday
... observance=pd.tseries.holiday.nearest_workday
... )
>>> NewYears # doctest: +SKIP
Holiday: New Years Day (
month=1, day=1, observance=<function nearest_workday at 0x66545e9bc440>
)

>>> July3rd = Holiday("July 3rd", month=7, day=3, days_of_week=(0, 1, 2, 3))
>>> July3rd = pd.tseries.holiday.Holiday(
... "July 3rd", month=7, day=3,
... days_of_week=(0, 1, 2, 3)
... )
>>> July3rd
Holiday: July 3rd (month=7, day=3, )
"""
Expand Down