Skip to content

CLN: clean signature in Groupby.add_numeric_operations #31473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 31, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -1359,17 +1359,17 @@ def groupby_function(
@Substitution(name="groupby", f=name)
@Appender(_common_see_also)
@Appender(_local_template)
def f(self, **kwargs):
if "numeric_only" not in kwargs:
kwargs["numeric_only"] = numeric_only
if "min_count" not in kwargs:
kwargs["min_count"] = min_count

def func(self, numeric_only=numeric_only, min_count=min_count):
self._set_group_selection()

# try a cython aggregation if we can
try:
return self._cython_agg_general(alias, alt=npfunc, **kwargs)
return self._cython_agg_general(
how=alias,
alt=npfunc,
numeric_only=numeric_only,
min_count=min_count,
)
except DataError:
pass
except NotImplementedError as err:
Expand All @@ -1384,9 +1384,9 @@ def f(self, **kwargs):
result = self.aggregate(lambda x: npfunc(x, axis=self.axis))
return result

set_function_name(f, name, cls)
set_function_name(func, name, cls)

return f
return func

def first_compat(x, axis=0):
def first(x):
Expand Down