We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f55da3 commit 2b38236Copy full SHA for 2b38236
scripts/benchmark/db-benchmark/groupby/G1_1e9_1e2_5_0/q8.py
@@ -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