From 4caa1d0c56aaba87934ae9a4ee7bb67b338a43ac Mon Sep 17 00:00:00 2001 From: Will Ayd Date: Mon, 5 Feb 2018 18:27:08 -0800 Subject: [PATCH] Lint fixes --- pandas/core/groupby.py | 9 +++++---- pandas/tests/groupby/test_groupby.py | 7 ++++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py index 2acb526bd21c0a..ad927a78bf62be 100644 --- a/pandas/core/groupby.py +++ b/pandas/core/groupby.py @@ -1002,7 +1002,8 @@ def _cython_transform(self, how, numeric_only=True, **kwargs): continue try: - result, names = self.grouper.transform(obj.values, how, **kwargs) + result, names = self.grouper.transform(obj.values, how, + **kwargs) except NotImplementedError: continue except AssertionError as e: @@ -1776,9 +1777,9 @@ def cumcount(self, ascending=True): def rank(self, method='average', ascending=True, na_option='keep', pct=False, axis=0): """Rank within each group""" - return self._cython_transform('rank', numeric_only=False, ties_method=method, - ascending=ascending, na_option=na_option, - pct=pct, axis=axis) + return self._cython_transform('rank', numeric_only=False, + ties_method=method, ascending=ascending, + na_option=na_option, pct=pct, axis=axis) @Substitution(name='groupby') @Appender(_doc_template) diff --git a/pandas/tests/groupby/test_groupby.py b/pandas/tests/groupby/test_groupby.py index d7f1aac59f91d9..efca59a2cb754b 100644 --- a/pandas/tests/groupby/test_groupby.py +++ b/pandas/tests/groupby/test_groupby.py @@ -1930,8 +1930,8 @@ def test_rank_args(self, grps, vals, ties_method, ascending, pct, exp): key = np.repeat(grps, len(vals)) vals = vals * len(grps) df = DataFrame({'key': key, 'val': vals}) - result = df.groupby('key').rank(method=ties_method, ascending=ascending, - pct=pct) + result = df.groupby('key').rank(method=ties_method, + ascending=ascending, pct=pct) exp_df = DataFrame(exp * len(grps), columns=['val']) assert_frame_equal(result, exp_df) @@ -2024,7 +2024,8 @@ def test_rank_args_missing(self, grps, vals, ties_method, ascending, key = np.repeat(grps, len(vals)) vals = vals * len(grps) df = DataFrame({'key': key, 'val': vals}) - result = df.groupby('key').rank(method=ties_method, ascending=ascending, + result = df.groupby('key').rank(method=ties_method, + ascending=ascending, na_option=na_option, pct=pct) exp_df = DataFrame(exp * len(grps), columns=['val'])