From 7225b0f4bb6a4ac8346ddad3797d427d703ae234 Mon Sep 17 00:00:00 2001 From: Jack Bicknell Date: Tue, 1 Oct 2019 05:08:12 +0100 Subject: [PATCH] DOC: Fixed PR08 docstring errors in pandas.tseries (#28571) --- pandas/tseries/offsets.py | 116 +++++++++++++++++++++++--------------- 1 file changed, 70 insertions(+), 46 deletions(-) diff --git a/pandas/tseries/offsets.py b/pandas/tseries/offsets.py index 82cbfa831bf324..4ebb4f353a8fd3 100644 --- a/pandas/tseries/offsets.py +++ b/pandas/tseries/offsets.py @@ -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) @@ -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" @@ -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" @@ -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. @@ -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" @@ -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. @@ -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" @@ -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())