Skip to content
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
13 changes: 8 additions & 5 deletions asv_bench/benchmarks/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ class GroupByMethods:
"var",
],
["direct", "transformation"],
[1, 2, 5, 10],
[1, 5],
]

def setup(self, dtype, method, application, ncols):
Expand All @@ -455,6 +455,7 @@ def setup(self, dtype, method, application, ncols):
raise NotImplementedError

if application == "transformation" and method in [
"describe",
"head",
"tail",
"unique",
Expand All @@ -464,7 +465,12 @@ def setup(self, dtype, method, application, ncols):
# DataFrameGroupBy doesn't have these methods
raise NotImplementedError

ngroups = 1000
if method == "describe":
ngroups = 20
elif method in ["mad", "skew"]:
ngroups = 100
else:
ngroups = 1000
size = ngroups * 2
rng = np.arange(ngroups).reshape(-1, 1)
rng = np.broadcast_to(rng, (len(rng), ncols))
Expand All @@ -491,9 +497,6 @@ def setup(self, dtype, method, application, ncols):
cols = cols[0]

if application == "transformation":
if method == "describe":
raise NotImplementedError

self.as_group_method = lambda: df.groupby("key")[cols].transform(method)
self.as_field_method = lambda: df.groupby(cols)["key"].transform(method)
else:
Expand Down