diff --git a/asv_bench/benchmarks/groupby.py b/asv_bench/benchmarks/groupby.py index 86322661a4e8a..ff58e382a9ba2 100644 --- a/asv_bench/benchmarks/groupby.py +++ b/asv_bench/benchmarks/groupby.py @@ -443,7 +443,7 @@ class GroupByMethods: "var", ], ["direct", "transformation"], - [1, 2, 5, 10], + [1, 5], ] def setup(self, dtype, method, application, ncols): @@ -455,6 +455,7 @@ def setup(self, dtype, method, application, ncols): raise NotImplementedError if application == "transformation" and method in [ + "describe", "head", "tail", "unique", @@ -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)) @@ -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: