Skip to content
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

DOC: Fixed PR08 docstring errors in pandas.tseries #28571

Merged
merged 11 commits into from
Oct 1, 2019
116 changes: 70 additions & 46 deletions pandas/tseries/offsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,9 +1007,9 @@ class CustomBusinessDay(_CustomMixin, BusinessDay):
normalize : bool, default False
Normalize start/end dates to midnight before generating date range
weekmask : str, Default 'Mon Tue Wed Thu Fri'
weekmask of valid business days, passed to ``numpy.busdaycalendar``
Weekmask of valid business days, passed to ``numpy.busdaycalendar``
holidays : list
list/array of dates to exclude from the set of valid business days,
List/array of dates to exclude from the set of valid business days,
passed to ``numpy.busdaycalendar``
calendar : pd.HolidayCalendar or np.busdaycalendar
offset : timedelta, default timedelta(0)
Expand Down Expand Up @@ -1671,16 +1671,19 @@ class WeekOfMonth(_WeekOfMonthMixin, DateOffset):
Parameters
----------
n : int
week : {0, 1, 2, 3, ...}, default 0
0 is 1st week of month, 1 2nd week, etc.
weekday : {0, 1, ..., 6}, default 0
0: Mondays
1: Tuesdays
2: Wednesdays
3: Thursdays
4: Fridays
5: Saturdays
6: Sundays
week : int {0, 1, 2, 3, ...}, default 0
A specific integer for the week of the month.
e.g. 0 is 1st week of month, 1 is the 2nd week, etc.
weekday : int {0, 1, ..., 6}, default 0
A specific integer for the day of the week.
- 0 is Monday
- 1 is Tuesday
- 2 is Wednesday
- 3 is Thursday
- 4 is Friday
- 5 is Saturday
- 6 is Sunday
"""

_prefix = "WOM"
Expand Down Expand Up @@ -1747,14 +1750,16 @@ class LastWeekOfMonth(_WeekOfMonthMixin, DateOffset):
Parameters
----------
n : int, default 1
weekday : {0, 1, ..., 6}, default 0
0: Mondays
1: Tuesdays
2: Wednesdays
3: Thursdays
4: Fridays
5: Saturdays
6: Sundays
weekday : int {0, 1, ..., 6}, default 0
A specific integer for the day of the week.
- 0 is Monday
- 1 is Tuesday
- 2 is Wednesday
- 3 is Thursday
- 4 is Friday
- 5 is Saturday
- 6 is Sunday
"""

_prefix = "LWOM"
Expand Down Expand Up @@ -2055,6 +2060,7 @@ class FY5253(DateOffset):
http://en.wikipedia.org/wiki/4-4-5_calendar
The year may either:
- end on the last X day of the Y month.
- end on the last X day closest to the last day of the Y month.
Expand All @@ -2064,17 +2070,25 @@ class FY5253(DateOffset):
Parameters
----------
n : int
weekday : {0, 1, ..., 6}
0: Mondays
1: Tuesdays
2: Wednesdays
3: Thursdays
4: Fridays
5: Saturdays
6: Sundays
startingMonth : The month in which fiscal years end. {1, 2, ... 12}
variation : str
{"nearest", "last"} for "LastOfMonth" or "NearestEndMonth"
weekday : int {0, 1, ..., 6}, default 0
A specific integer for the day of the week.
- 0 is Monday
- 1 is Tuesday
- 2 is Wednesday
- 3 is Thursday
- 4 is Friday
- 5 is Saturday
- 6 is Sunday
startingMonth : int {1, 2, ... 12}, default 1
The month in which the fiscal year ends.
variation : str, default "nearest"
Method of employing 4-4-5 calendar. There are two options:
- "nearest" means year end is **weekday** closest to last day of month in year.
- "last" means year end is final **weekday** of the final month in fiscal year.
"""

_prefix = "RE"
Expand Down Expand Up @@ -2258,6 +2272,7 @@ class FY5253Quarter(DateOffset):
http://en.wikipedia.org/wiki/4-4-5_calendar
The year may either:
- end on the last X day of the Y month.
- end on the last X day closest to the last day of the Y month.
Expand All @@ -2271,19 +2286,28 @@ class FY5253Quarter(DateOffset):
Parameters
----------
n : int
weekday : {0, 1, ..., 6}
0: Mondays
1: Tuesdays
2: Wednesdays
3: Thursdays
4: Fridays
5: Saturdays
6: Sundays
startingMonth : The month in which fiscal years end. {1, 2, ... 12}
qtr_with_extra_week : The quarter number that has the leap
or 14 week when needed. {1,2,3,4}
variation : str
{"nearest", "last"} for "LastOfMonth" or "NearestEndMonth"
weekday : int {0, 1, ..., 6}, default 0
A specific integer for the day of the week.
- 0 is Monday
- 1 is Tuesday
- 2 is Wednesday
- 3 is Thursday
- 4 is Friday
- 5 is Saturday
- 6 is Sunday
startingMonth : int {1, 2, ..., 12}, default 1
The month in which fiscal years end.
qtr_with_extra_week : int {1, 2, 3, 4}, default 1
The quarter number that has the leap or 14 week when needed.
variation : str, default "nearest"
Method of employing 4-4-5 calendar. There are two options:
- "nearest" means year end is **weekday** closest to last day of month in year.
- "last" means year end is final **weekday** of the final month in fiscal year.
"""

_prefix = "REQ"
Expand Down Expand Up @@ -2707,8 +2731,8 @@ def generate_range(start=None, end=None, periods=None, offset=BDay()):
Parameters
----------
start : datetime (default None)
end : datetime (default None)
start : datetime, (default None)
end : datetime, (default None)
periods : int, (default None)
offset : DateOffset, (default BDay())
Expand Down