Skip to content

Commit

Permalink
TEST-#3710: add groupby benchmarks with dict aggregation for omnisci (#…
Browse files Browse the repository at this point in the history
…3711)

Signed-off-by: Anatoly Myachev <anatoly.myachev@intel.com>
  • Loading branch information
anmyachev authored Nov 24, 2021
1 parent 054e7fb commit 5ff0669
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions asv_bench/benchmarks/omnisci/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,9 @@ def setup(self, shape, ngroups=5, groupby_ncols=1):
groupby_ncols,
count_groups=ngroups,
)
# correct while we use 'col*' like name for non-groupby columns
# and 'groupby_col*' like name for groupby columns
self.non_groupby_columns = self.df.columns[:-groupby_ncols]
trigger_import(self.df)


Expand Down Expand Up @@ -449,3 +452,10 @@ def time_groupby_agg_mean(self, *args, **kwargs):

def time_groupby_agg_nunique(self, *args, **kwargs):
execute(self.df.groupby(by=self.groupby_columns).agg("nunique"))

def time_groupby_agg_mean_dict(self, *args, **kwargs):
execute(
self.df.groupby(by=self.groupby_columns).agg(
{col: "mean" for col in self.non_groupby_columns}
)
)

0 comments on commit 5ff0669

Please sign in to comment.