Skip to content

Commit 2b38236

Browse files
authored
chore: add dbbenchmark grouby benchmark q8 (#796)
1 parent 1f55da3 commit 2b38236

File tree

1 file changed

+19
-0
lines changed
  • scripts/benchmark/db-benchmark/groupby/G1_1e9_1e2_5_0

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Contains code from https://github.com/duckdblabs/db-benchmark/blob/master/pandas/groupby-pandas.py
2+
3+
import bigframes.pandas as bpd
4+
5+
print("Groupby benchmark 8: largest two v3 by id6")
6+
7+
x = bpd.read_gbq("bigframes-dev-perf.dbbenchmark.G1_1e9_1e2_5_0")
8+
9+
ans = (
10+
x[~x["v3"].isna()][["id6", "v3"]]
11+
.sort_values("v3", ascending=False)
12+
.groupby("id6", as_index=False, dropna=False)
13+
.head(2)
14+
)
15+
print(ans.shape)
16+
chk = [ans["v3"].sum()]
17+
print(chk)
18+
19+
bpd.reset_session()

0 commit comments

Comments
 (0)