From 0dc07f2ffe6b2257350eead27f65985eb8816a27 Mon Sep 17 00:00:00 2001 From: mwoss Date: Tue, 5 Feb 2019 16:02:33 +0100 Subject: [PATCH 01/11] Partial PR04 errors fix --- pandas/core/algorithms.py | 2 +- pandas/core/generic.py | 6 ++++-- pandas/core/groupby/groupby.py | 2 +- pandas/core/panel.py | 2 +- pandas/core/resample.py | 2 +- pandas/io/formats/style.py | 7 ++++--- pandas/io/parquet.py | 2 +- scripts/validate_docstrings.py | 2 +- 8 files changed, 14 insertions(+), 11 deletions(-) diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index b473a7aef929e..57892a2992f58 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -563,7 +563,7 @@ def _factorize_array(values, na_sentinel=-1, size_hint=None, coerced to ndarrays before factorization. """), order=dedent("""\ - order + order : None .. deprecated:: 0.23.0 This parameter has no effect and is deprecated. diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 0312ed6ecf3bf..6c67bfe7747f9 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -648,13 +648,15 @@ def transpose(self, *args, **kwargs): copy : boolean, default False Make a copy of the underlying data. Mixed-dtype data will always result in a copy + kwargs : Any additional keyword arguments will be passed as keywords to the function Returns - ------- + ---------- y : same as input + asdadasd Examples - -------- + ---------- >>> p.transpose(2, 0, 1) >>> p.transpose(2, 0, 1, copy=True) """ diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 8766fdbc29755..1f68349e6042c 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -1835,7 +1835,7 @@ def rank(self, method='average', ascending=True, na_option='keep', The axis of the object over which to compute the rank. Returns - ----- + ---------- DataFrame with ranking of values within each group """ if na_option not in {'keep', 'top', 'bottom'}: diff --git a/pandas/core/panel.py b/pandas/core/panel.py index 540192d1a592c..97eba023f53d2 100644 --- a/pandas/core/panel.py +++ b/pandas/core/panel.py @@ -1010,7 +1010,7 @@ def apply(self, func, axis='major', **kwargs): DataFrames of items & major axis will be passed axis : {'items', 'minor', 'major'}, or {0, 1, 2}, or a tuple with two axes - Additional keyword arguments will be passed as keywords to the function + kwargs : Additional keyword arguments will be passed as keywords to the function Returns ------- diff --git a/pandas/core/resample.py b/pandas/core/resample.py index a7204fcd9dd20..f2039c310662c 100644 --- a/pandas/core/resample.py +++ b/pandas/core/resample.py @@ -800,7 +800,7 @@ def std(self, ddof=1, *args, **kwargs): Parameters ---------- ddof : integer, default 1 - degrees of freedom + degrees of freedom """ nv.validate_resampler_func('std', args, kwargs) return self._downsample('std', ddof=ddof) diff --git a/pandas/io/formats/style.py b/pandas/io/formats/style.py index 61862ee0028d3..90c428cb23315 100644 --- a/pandas/io/formats/style.py +++ b/pandas/io/formats/style.py @@ -424,9 +424,10 @@ def render(self, **kwargs): Parameters ---------- - `**kwargs` : Any additional keyword arguments are passed through - to ``self.template.render``. This is useful when you need to provide - additional variables for a custom template. + kwargs : Any additional keyword arguments + keywords are passed throught o ``self.template.render``. + This is useful when you need to provide + additional variables for a custom template. .. versionadded:: 0.20 diff --git a/pandas/io/parquet.py b/pandas/io/parquet.py index dada9000d901a..181fadf050671 100644 --- a/pandas/io/parquet.py +++ b/pandas/io/parquet.py @@ -271,7 +271,7 @@ def read_parquet(path, engine='auto', columns=None, **kwargs): ``io.parquet.engine`` is used. The default ``io.parquet.engine`` behavior is to try 'pyarrow', falling back to 'fastparquet' if 'pyarrow' is unavailable. - kwargs are passed to the engine + kwargs: Any additional kwargs are passed to the engine Returns ------- diff --git a/scripts/validate_docstrings.py b/scripts/validate_docstrings.py index bce33f7e78daa..3689decb0a801 100755 --- a/scripts/validate_docstrings.py +++ b/scripts/validate_docstrings.py @@ -543,7 +543,7 @@ def validate_pep8(self): application = flake8.main.application.Application() application.initialize(["--quiet"]) - with tempfile.NamedTemporaryFile(mode='w') as file: + with tempfile.NamedTemporaryFile(mode='w', encoding="utf-8") as file: file.write(content) file.flush() application.run_checks([file.name]) From b93e438e8b1f883296fe701b7fa67ea8d3ee1074 Mon Sep 17 00:00:00 2001 From: mwoss Date: Wed, 6 Feb 2019 01:53:21 +0100 Subject: [PATCH 02/11] Fix rest of the R04 errors --- pandas/_libs/tslibs/timedeltas.pyx | 3 +-- pandas/core/groupby/grouper.py | 11 +++++++---- pandas/core/panel.py | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pandas/_libs/tslibs/timedeltas.pyx b/pandas/_libs/tslibs/timedeltas.pyx index 0a19d8749fc7c..10fa56345a1c7 100644 --- a/pandas/_libs/tslibs/timedeltas.pyx +++ b/pandas/_libs/tslibs/timedeltas.pyx @@ -1127,8 +1127,7 @@ class Timedelta(_Timedelta): 'ms', 'milliseconds', 'millisecond', 'milli', 'millis', 'L', 'us', 'microseconds', 'microsecond', 'micro', 'micros', 'U', 'ns', 'nanoseconds', 'nano', 'nanos', 'nanosecond', 'N'} - days, seconds, microseconds, - milliseconds, minutes, hours, weeks : numeric, optional + days,seconds,microseconds,milliseconds,minutes,hours,weeks : numeric, optional: Values for construction in compat with datetime.timedelta. np ints and floats will be coerced to python ints and floats. diff --git a/pandas/core/groupby/grouper.py b/pandas/core/groupby/grouper.py index 260417bc0d598..f20e64b0e8c32 100644 --- a/pandas/core/groupby/grouper.py +++ b/pandas/core/groupby/grouper.py @@ -55,18 +55,21 @@ class Grouper(object): sort : boolean, default to False whether to sort the resulting labels - additional kwargs to control time-like groupers (when `freq` is passed) - closed : closed end of interval; 'left' or 'right' label : interval boundary to use for labeling; 'left' or 'right' convention : {'start', 'end', 'e', 's'} If grouper is PeriodIndex - base, loffset + base : int, default 0 + loffset : string / DateOffset / timedelta object Returns ------- A specification for a groupby instruction - + Note + ------- + Kwargs to control time-like groupers: + closed, label, convetion, base and loffset + are taken into account when `freq` parameter is passed Examples -------- diff --git a/pandas/core/panel.py b/pandas/core/panel.py index 97eba023f53d2..c3a23c9468c83 100644 --- a/pandas/core/panel.py +++ b/pandas/core/panel.py @@ -42,7 +42,7 @@ axes_single_arg="{0, 1, 2, 'items', 'major_axis', 'minor_axis'}", optional_mapper='', optional_axis='', optional_labels='') _shared_doc_kwargs['args_transpose'] = ( - "three positional arguments: each one of\n{ax_single}".format( + "{ax_single}\n\tthree positional arguments from given options".format( ax_single=_shared_doc_kwargs['axes_single_arg'])) From ae369ecc7b4ae225267669ef458606cc38b79bb9 Mon Sep 17 00:00:00 2001 From: mwoss Date: Wed, 6 Feb 2019 01:56:19 +0100 Subject: [PATCH 03/11] PEP8 - line too long fix --- pandas/core/generic.py | 2 +- pandas/core/panel.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 6c67bfe7747f9..ca4132c531e1f 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -648,7 +648,7 @@ def transpose(self, *args, **kwargs): copy : boolean, default False Make a copy of the underlying data. Mixed-dtype data will always result in a copy - kwargs : Any additional keyword arguments will be passed as keywords to the function + kwargs : Additional keyword arguments will be passed to the function Returns ---------- diff --git a/pandas/core/panel.py b/pandas/core/panel.py index c3a23c9468c83..61820c95b86a3 100644 --- a/pandas/core/panel.py +++ b/pandas/core/panel.py @@ -1010,7 +1010,7 @@ def apply(self, func, axis='major', **kwargs): DataFrames of items & major axis will be passed axis : {'items', 'minor', 'major'}, or {0, 1, 2}, or a tuple with two axes - kwargs : Additional keyword arguments will be passed as keywords to the function + kwargs : Additional keyword arguments will be passed to the function Returns ------- From 3ac23836ed9e3c9db8e58ab4d1b96af9800c7f8e Mon Sep 17 00:00:00 2001 From: mwoss Date: Wed, 6 Feb 2019 10:27:48 +0100 Subject: [PATCH 04/11] Add additional space between param name and type, add new lines to --- pandas/core/generic.py | 1 - pandas/core/groupby/grouper.py | 2 ++ pandas/io/parquet.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index ca4132c531e1f..a441ebed55d4c 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -653,7 +653,6 @@ def transpose(self, *args, **kwargs): Returns ---------- y : same as input - asdadasd Examples ---------- diff --git a/pandas/core/groupby/grouper.py b/pandas/core/groupby/grouper.py index f20e64b0e8c32..2ce3c69b9ebb3 100644 --- a/pandas/core/groupby/grouper.py +++ b/pandas/core/groupby/grouper.py @@ -65,11 +65,13 @@ class Grouper(object): Returns ------- A specification for a groupby instruction + Note ------- Kwargs to control time-like groupers: closed, label, convetion, base and loffset are taken into account when `freq` parameter is passed + Examples -------- diff --git a/pandas/io/parquet.py b/pandas/io/parquet.py index 181fadf050671..544d7779e58c9 100644 --- a/pandas/io/parquet.py +++ b/pandas/io/parquet.py @@ -271,7 +271,7 @@ def read_parquet(path, engine='auto', columns=None, **kwargs): ``io.parquet.engine`` is used. The default ``io.parquet.engine`` behavior is to try 'pyarrow', falling back to 'fastparquet' if 'pyarrow' is unavailable. - kwargs: Any additional kwargs are passed to the engine + kwargs : Any additional kwargs are passed to the engine Returns ------- From 7651a631962615493f1f3eaaf99272fd9370a52f Mon Sep 17 00:00:00 2001 From: mwoss Date: Wed, 6 Feb 2019 10:37:18 +0100 Subject: [PATCH 05/11] Add PR04 errors check to code_check script --- ci/code_checks.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index f71d2ce68f800..e682d6fb450f2 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -240,8 +240,8 @@ fi ### DOCSTRINGS ### if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then - MSG='Validate docstrings (GL06, GL07, GL09, SS04, PR03, PR05, EX04)' ; echo $MSG - $BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,PR03,PR05,EX04 + MSG='Validate docstrings (GL06, GL07, GL09, SS04, PR03, PR04, PR05, EX04)' ; echo $MSG + $BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,PR03,PR04,PR05,EX04 RET=$(($RET + $?)) ; echo $MSG "DONE" fi From ce46f242e04a374cdd8b90f893d3f2367c6d5930 Mon Sep 17 00:00:00 2001 From: mwoss Date: Thu, 7 Feb 2019 00:42:47 +0100 Subject: [PATCH 06/11] Additional docs fixes related to PR04 errors --- pandas/_libs/tslibs/timedeltas.pyx | 6 ++++-- pandas/core/generic.py | 7 ++++--- pandas/core/groupby/groupby.py | 2 +- pandas/core/groupby/grouper.py | 2 +- pandas/core/panel.py | 5 +++-- pandas/core/resample.py | 2 +- pandas/io/formats/style.py | 5 +++-- pandas/io/parquet.py | 3 ++- scripts/validate_docstrings.py | 2 +- 9 files changed, 20 insertions(+), 14 deletions(-) diff --git a/pandas/_libs/tslibs/timedeltas.pyx b/pandas/_libs/tslibs/timedeltas.pyx index 10fa56345a1c7..9893a084c5d2f 100644 --- a/pandas/_libs/tslibs/timedeltas.pyx +++ b/pandas/_libs/tslibs/timedeltas.pyx @@ -1127,9 +1127,11 @@ class Timedelta(_Timedelta): 'ms', 'milliseconds', 'millisecond', 'milli', 'millis', 'L', 'us', 'microseconds', 'microsecond', 'micro', 'micros', 'U', 'ns', 'nanoseconds', 'nano', 'nanos', 'nanosecond', 'N'} - days,seconds,microseconds,milliseconds,minutes,hours,weeks : numeric, optional: + **kwargs : numeric, optional + Available kwargs: {days, seconds, microseconds, + milliseconds, minutes, hours, weeks}. Values for construction in compat with datetime.timedelta. - np ints and floats will be coerced to python ints and floats. + Numpy ints and floats will be coerced to python ints and floats. Notes ----- diff --git a/pandas/core/generic.py b/pandas/core/generic.py index a441ebed55d4c..b7fd42f80e685 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -648,14 +648,15 @@ def transpose(self, *args, **kwargs): copy : boolean, default False Make a copy of the underlying data. Mixed-dtype data will always result in a copy - kwargs : Additional keyword arguments will be passed to the function + **kwargs : + Additional keyword arguments will be passed to the function. Returns - ---------- + ------- y : same as input Examples - ---------- + -------- >>> p.transpose(2, 0, 1) >>> p.transpose(2, 0, 1, copy=True) """ diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 1f68349e6042c..a389d5c28822d 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -1835,7 +1835,7 @@ def rank(self, method='average', ascending=True, na_option='keep', The axis of the object over which to compute the rank. Returns - ---------- + ------- DataFrame with ranking of values within each group """ if na_option not in {'keep', 'top', 'bottom'}: diff --git a/pandas/core/groupby/grouper.py b/pandas/core/groupby/grouper.py index 2ce3c69b9ebb3..536c04a1de111 100644 --- a/pandas/core/groupby/grouper.py +++ b/pandas/core/groupby/grouper.py @@ -60,7 +60,7 @@ class Grouper(object): convention : {'start', 'end', 'e', 's'} If grouper is PeriodIndex base : int, default 0 - loffset : string / DateOffset / timedelta object + loffset : string, DateOffset, timedelta object Returns ------- diff --git a/pandas/core/panel.py b/pandas/core/panel.py index 61820c95b86a3..30acfaacd9e8e 100644 --- a/pandas/core/panel.py +++ b/pandas/core/panel.py @@ -42,7 +42,7 @@ axes_single_arg="{0, 1, 2, 'items', 'major_axis', 'minor_axis'}", optional_mapper='', optional_axis='', optional_labels='') _shared_doc_kwargs['args_transpose'] = ( - "{ax_single}\n\tthree positional arguments from given options".format( + "{ax_single}\n\tThree positional arguments from given options.".format( ax_single=_shared_doc_kwargs['axes_single_arg'])) @@ -1010,7 +1010,8 @@ def apply(self, func, axis='major', **kwargs): DataFrames of items & major axis will be passed axis : {'items', 'minor', 'major'}, or {0, 1, 2}, or a tuple with two axes - kwargs : Additional keyword arguments will be passed to the function + **kwargs : + Additional keyword arguments will be passed to the function. Returns ------- diff --git a/pandas/core/resample.py b/pandas/core/resample.py index f2039c310662c..6696c6fa9636b 100644 --- a/pandas/core/resample.py +++ b/pandas/core/resample.py @@ -800,7 +800,7 @@ def std(self, ddof=1, *args, **kwargs): Parameters ---------- ddof : integer, default 1 - degrees of freedom + Degrees of freedom. """ nv.validate_resampler_func('std', args, kwargs) return self._downsample('std', ddof=ddof) diff --git a/pandas/io/formats/style.py b/pandas/io/formats/style.py index 90c428cb23315..1b8771535eafd 100644 --- a/pandas/io/formats/style.py +++ b/pandas/io/formats/style.py @@ -424,8 +424,9 @@ def render(self, **kwargs): Parameters ---------- - kwargs : Any additional keyword arguments - keywords are passed throught o ``self.template.render``. + **kwargs : + Any additional keyword arguments are passed + through to ``self.template.render``. This is useful when you need to provide additional variables for a custom template. diff --git a/pandas/io/parquet.py b/pandas/io/parquet.py index 544d7779e58c9..789871e19f5a8 100644 --- a/pandas/io/parquet.py +++ b/pandas/io/parquet.py @@ -271,7 +271,8 @@ def read_parquet(path, engine='auto', columns=None, **kwargs): ``io.parquet.engine`` is used. The default ``io.parquet.engine`` behavior is to try 'pyarrow', falling back to 'fastparquet' if 'pyarrow' is unavailable. - kwargs : Any additional kwargs are passed to the engine + **kwargs : + Any additional kwargs are passed to the engine. Returns ------- diff --git a/scripts/validate_docstrings.py b/scripts/validate_docstrings.py index 3689decb0a801..bce33f7e78daa 100755 --- a/scripts/validate_docstrings.py +++ b/scripts/validate_docstrings.py @@ -543,7 +543,7 @@ def validate_pep8(self): application = flake8.main.application.Application() application.initialize(["--quiet"]) - with tempfile.NamedTemporaryFile(mode='w', encoding="utf-8") as file: + with tempfile.NamedTemporaryFile(mode='w') as file: file.write(content) file.flush() application.run_checks([file.name]) From 63aaaf0b5ee83a0b60c241942df55ce9aa18c57a Mon Sep 17 00:00:00 2001 From: mwoss Date: Fri, 8 Feb 2019 00:38:44 +0100 Subject: [PATCH 07/11] Remove unnecessary colons and note section in Grouper docs --- pandas/_libs/tslibs/timedeltas.pyx | 2 +- pandas/core/generic.py | 2 +- pandas/core/groupby/grouper.py | 13 +++++-------- pandas/io/formats/style.py | 2 +- pandas/io/parquet.py | 2 +- scripts/validate_docstrings.py | 2 +- 6 files changed, 10 insertions(+), 13 deletions(-) diff --git a/pandas/_libs/tslibs/timedeltas.pyx b/pandas/_libs/tslibs/timedeltas.pyx index 9893a084c5d2f..b6cb1d3012cee 100644 --- a/pandas/_libs/tslibs/timedeltas.pyx +++ b/pandas/_libs/tslibs/timedeltas.pyx @@ -1127,7 +1127,7 @@ class Timedelta(_Timedelta): 'ms', 'milliseconds', 'millisecond', 'milli', 'millis', 'L', 'us', 'microseconds', 'microsecond', 'micro', 'micros', 'U', 'ns', 'nanoseconds', 'nano', 'nanos', 'nanosecond', 'N'} - **kwargs : numeric, optional + **kwargs Available kwargs: {days, seconds, microseconds, milliseconds, minutes, hours, weeks}. Values for construction in compat with datetime.timedelta. diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 738da7ffe154b..9d82d541a5265 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -648,7 +648,7 @@ def transpose(self, *args, **kwargs): copy : boolean, default False Make a copy of the underlying data. Mixed-dtype data will always result in a copy - **kwargs : + **kwargs Additional keyword arguments will be passed to the function. Returns diff --git a/pandas/core/groupby/grouper.py b/pandas/core/groupby/grouper.py index 536c04a1de111..65db765b56bea 100644 --- a/pandas/core/groupby/grouper.py +++ b/pandas/core/groupby/grouper.py @@ -54,24 +54,21 @@ class Grouper(object): axis : number/name of the axis, defaults to 0 sort : boolean, default to False whether to sort the resulting labels - closed : closed end of interval; 'left' or 'right' + Only when `freq` parameter is passed. label : interval boundary to use for labeling; 'left' or 'right' + Only when `freq` parameter is passed. convention : {'start', 'end', 'e', 's'} - If grouper is PeriodIndex + If grouper is PeriodIndex and `freq` parameter is passed. base : int, default 0 + Only when `freq` parameter is passed. loffset : string, DateOffset, timedelta object + Only when `freq` parameter is passed. Returns ------- A specification for a groupby instruction - Note - ------- - Kwargs to control time-like groupers: - closed, label, convetion, base and loffset - are taken into account when `freq` parameter is passed - Examples -------- diff --git a/pandas/io/formats/style.py b/pandas/io/formats/style.py index c531de475c3d6..7401b57877ff4 100644 --- a/pandas/io/formats/style.py +++ b/pandas/io/formats/style.py @@ -424,7 +424,7 @@ def render(self, **kwargs): Parameters ---------- - **kwargs : + **kwargs Any additional keyword arguments are passed through to ``self.template.render``. This is useful when you need to provide diff --git a/pandas/io/parquet.py b/pandas/io/parquet.py index 789871e19f5a8..aa4dcfe5a06c1 100644 --- a/pandas/io/parquet.py +++ b/pandas/io/parquet.py @@ -271,7 +271,7 @@ def read_parquet(path, engine='auto', columns=None, **kwargs): ``io.parquet.engine`` is used. The default ``io.parquet.engine`` behavior is to try 'pyarrow', falling back to 'fastparquet' if 'pyarrow' is unavailable. - **kwargs : + **kwargs Any additional kwargs are passed to the engine. Returns diff --git a/scripts/validate_docstrings.py b/scripts/validate_docstrings.py index bce33f7e78daa..dc65723bec74e 100755 --- a/scripts/validate_docstrings.py +++ b/scripts/validate_docstrings.py @@ -543,7 +543,7 @@ def validate_pep8(self): application = flake8.main.application.Application() application.initialize(["--quiet"]) - with tempfile.NamedTemporaryFile(mode='w') as file: + with tempfile.NamedTemporaryFile(mode='w', encoding='utf-8') as file: file.write(content) file.flush() application.run_checks([file.name]) From aeed6ab0e44134de23b98f7fbdcc3ec1cc871902 Mon Sep 17 00:00:00 2001 From: mwoss Date: Fri, 8 Feb 2019 01:22:01 +0100 Subject: [PATCH 08/11] Change parameter order --- pandas/io/parquet.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/io/parquet.py b/pandas/io/parquet.py index aa4dcfe5a06c1..ba322f42c07c1 100644 --- a/pandas/io/parquet.py +++ b/pandas/io/parquet.py @@ -262,15 +262,15 @@ def read_parquet(path, engine='auto', columns=None, **kwargs): ---------- path : string File path - columns : list, default=None - If not None, only these columns will be read from the file. - - .. versionadded 0.21.1 engine : {'auto', 'pyarrow', 'fastparquet'}, default 'auto' Parquet library to use. If 'auto', then the option ``io.parquet.engine`` is used. The default ``io.parquet.engine`` behavior is to try 'pyarrow', falling back to 'fastparquet' if 'pyarrow' is unavailable. + columns : list, default=None + If not None, only these columns will be read from the file. + + .. versionadded 0.21.1 **kwargs Any additional kwargs are passed to the engine. From 4bb3b0b44c6400c30a1c67acbad3bf4129a28dff Mon Sep 17 00:00:00 2001 From: mwoss Date: Fri, 8 Feb 2019 20:12:11 +0100 Subject: [PATCH 09/11] Remove encoding param in opening named temp file --- scripts/validate_docstrings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/validate_docstrings.py b/scripts/validate_docstrings.py index dc65723bec74e..bce33f7e78daa 100755 --- a/scripts/validate_docstrings.py +++ b/scripts/validate_docstrings.py @@ -543,7 +543,7 @@ def validate_pep8(self): application = flake8.main.application.Application() application.initialize(["--quiet"]) - with tempfile.NamedTemporaryFile(mode='w', encoding='utf-8') as file: + with tempfile.NamedTemporaryFile(mode='w') as file: file.write(content) file.flush() application.run_checks([file.name]) From 619253cd1cea2539642136355f2eb03fbbd8230e Mon Sep 17 00:00:00 2001 From: mwoss Date: Mon, 11 Feb 2019 00:25:02 +0100 Subject: [PATCH 10/11] Separate types and descriptions --- pandas/core/groupby/grouper.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pandas/core/groupby/grouper.py b/pandas/core/groupby/grouper.py index 9878f0a6a1e3c..fc32a281b99de 100644 --- a/pandas/core/groupby/grouper.py +++ b/pandas/core/groupby/grouper.py @@ -54,9 +54,10 @@ class Grouper(object): axis : number/name of the axis, defaults to 0 sort : boolean, default to False whether to sort the resulting labels - closed : closed end of interval; 'left' or 'right' - Only when `freq` parameter is passed. - label : interval boundary to use for labeling; 'left' or 'right' + closed : {'left' or 'right'} + Closed end of interval. Only when `freq` parameter is passed. + label : {'left' or 'right'} + Interval boundary to use for labeling. Only when `freq` parameter is passed. convention : {'start', 'end', 'e', 's'} If grouper is PeriodIndex and `freq` parameter is passed. From bffd111ff6213170e0cbff4bff65b0a6f55461a5 Mon Sep 17 00:00:00 2001 From: William Ayd Date: Sun, 10 Feb 2019 17:05:48 -0800 Subject: [PATCH 11/11] Remove errant colon --- pandas/core/panel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/panel.py b/pandas/core/panel.py index c2088b1a8e16f..dda5533f1ea7b 100644 --- a/pandas/core/panel.py +++ b/pandas/core/panel.py @@ -1009,7 +1009,7 @@ def apply(self, func, axis='major', **kwargs): DataFrames of items & major axis will be passed axis : {'items', 'minor', 'major'}, or {0, 1, 2}, or a tuple with two axes - **kwargs : + **kwargs Additional keyword arguments will be passed to the function. Returns