diff --git a/scripts/benchmark/db-benchmark/groupby/G1_1e9_1e2_5_0/q10.py b/scripts/benchmark/db-benchmark/groupby/G1_1e9_1e2_5_0/q10.py new file mode 100644 index 0000000000..83d5d4ee14 --- /dev/null +++ b/scripts/benchmark/db-benchmark/groupby/G1_1e9_1e2_5_0/q10.py @@ -0,0 +1,16 @@ +# Contains code from https://github.com/duckdblabs/db-benchmark/blob/master/pandas/groupby-pandas.py + +import bigframes.pandas as bpd + +print("Groupby benchmark 10: sum v3 count by id1:id6") + +x = bpd.read_gbq("bigframes-dev-perf.dbbenchmark.G1_1e9_1e2_5_0") + +ans = x.groupby( + ["id1", "id2", "id3", "id4", "id5", "id6"], as_index=False, dropna=False +).agg({"v3": "sum", "v1": "size"}) +print(ans.shape) +chk = [ans["v3"].sum(), ans["v1"].sum()] +print(chk) + +bpd.reset_session() diff --git a/scripts/benchmark/db-benchmark/groupby/G1_1e9_1e2_5_0/q8.py b/scripts/benchmark/db-benchmark/groupby/G1_1e9_1e2_5_0/q8.py index 4bbad0048f..7a57d03efe 100644 --- a/scripts/benchmark/db-benchmark/groupby/G1_1e9_1e2_5_0/q8.py +++ b/scripts/benchmark/db-benchmark/groupby/G1_1e9_1e2_5_0/q8.py @@ -12,6 +12,7 @@ .groupby("id6", as_index=False, dropna=False) .head(2) ) +ans = ans.reset_index(drop=True) print(ans.shape) chk = [ans["v3"].sum()] print(chk)