From ad03c41ef57a00a3822d46d2df613f30c3031713 Mon Sep 17 00:00:00 2001 From: ladyyvii Date: Tue, 1 Oct 2019 11:10:15 +0100 Subject: [PATCH 1/3] DOC: Fixed PR09 docstring errors in pandas.tseries (#27977) --- pandas/tseries/offsets.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pandas/tseries/offsets.py b/pandas/tseries/offsets.py index 4ebb4f353a8fd..81d8869dd7ba0 100644 --- a/pandas/tseries/offsets.py +++ b/pandas/tseries/offsets.py @@ -204,7 +204,8 @@ def __add__(date): normalize : bool, default False Whether to round the result of a DateOffset addition down to the previous midnight. - **kwds : Temporal parameter that add to or replace the offset value. + **kwds + Temporal parameter that add to or replace the offset value. Parameters that **add** to the offset (like Timedelta): @@ -1005,12 +1006,12 @@ class CustomBusinessDay(_CustomMixin, BusinessDay): ---------- n : int, default 1 normalize : bool, default False - Normalize start/end dates to midnight before generating date range + 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, - passed to ``numpy.busdaycalendar`` + passed to ``numpy.busdaycalendar``. calendar : pd.HolidayCalendar or np.busdaycalendar offset : timedelta, default timedelta(0) """ @@ -1519,7 +1520,7 @@ class Week(DateOffset): Parameters ---------- weekday : int, default None - Always generate specific day of week. 0 for Monday + Always generate specific day of week. 0 for Monday. """ _adjust_dst = True @@ -2085,7 +2086,9 @@ class FY5253(DateOffset): The month in which the fiscal year ends. variation : str, default "nearest" - Method of employing 4-4-5 calendar. There are two options: + 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. @@ -2304,7 +2307,9 @@ class FY5253Quarter(DateOffset): 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: + 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. From 4a7662e01fcfc41ea534ca7851d2e86b47e4bf38 Mon Sep 17 00:00:00 2001 From: ladyyvii Date: Tue, 1 Oct 2019 12:55:51 +0100 Subject: [PATCH 2/3] fixed test_spam_url test by changing a url address to the same html page stored in the pandas github repo --- pandas/tests/io/test_html.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/tests/io/test_html.py b/pandas/tests/io/test_html.py index 183d217eb09d6..1045b72f0aa6e 100644 --- a/pandas/tests/io/test_html.py +++ b/pandas/tests/io/test_html.py @@ -135,8 +135,8 @@ def test_banklist_url(self): @network def test_spam_url(self): url = ( - "http://ndb.nal.usda.gov/ndb/foods/show/300772?fg=&man=&" - "lfacet=&format=&count=&max=25&offset=&sort=&qlookup=spam" + "https://raw.githubusercontent.com/pandas-dev/pandas/master/" + "pandas/tests/io/data/spam.html" ) df1 = self.read_html(url, ".*Water.*") df2 = self.read_html(url, "Unit") From 478d686b1a1f2d3073202847af2710ae1352cdcc Mon Sep 17 00:00:00 2001 From: ladyyvii Date: Tue, 1 Oct 2019 13:06:28 +0100 Subject: [PATCH 3/3] Revert "DOC: Fixed PR09 docstring errors in pandas.tseries (#27977)" This reverts commit ad03c41ef57a00a3822d46d2df613f30c3031713. --- pandas/tseries/offsets.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/pandas/tseries/offsets.py b/pandas/tseries/offsets.py index 81d8869dd7ba0..4ebb4f353a8fd 100644 --- a/pandas/tseries/offsets.py +++ b/pandas/tseries/offsets.py @@ -204,8 +204,7 @@ def __add__(date): normalize : bool, default False Whether to round the result of a DateOffset addition down to the previous midnight. - **kwds - Temporal parameter that add to or replace the offset value. + **kwds : Temporal parameter that add to or replace the offset value. Parameters that **add** to the offset (like Timedelta): @@ -1006,12 +1005,12 @@ class CustomBusinessDay(_CustomMixin, BusinessDay): ---------- n : int, default 1 normalize : bool, default False - Normalize start/end dates to midnight before generating date range. + 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, - passed to ``numpy.busdaycalendar``. + passed to ``numpy.busdaycalendar`` calendar : pd.HolidayCalendar or np.busdaycalendar offset : timedelta, default timedelta(0) """ @@ -1520,7 +1519,7 @@ class Week(DateOffset): Parameters ---------- weekday : int, default None - Always generate specific day of week. 0 for Monday. + Always generate specific day of week. 0 for Monday """ _adjust_dst = True @@ -2086,9 +2085,7 @@ class FY5253(DateOffset): The month in which the fiscal year ends. variation : str, default "nearest" - Method of employing 4-4-5 calendar. - - There are two options: + 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. @@ -2307,9 +2304,7 @@ class FY5253Quarter(DateOffset): 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: + 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.