Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAyd committed Feb 6, 2018
1 parent 6765acd commit 4caa1d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 5 additions & 4 deletions pandas/core/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 4 additions & 3 deletions pandas/tests/groupby/test_groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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'])
Expand Down

0 comments on commit 4caa1d0

Please sign in to comment.