Spaces:
Sleeping
Sleeping
fixed groupby to group_by
Browse files
app.py
CHANGED
|
@@ -150,7 +150,7 @@ def bench_filter(df: pd.DataFrame, repeats=3):
|
|
| 150 |
|
| 151 |
def bench_groupby(df: pd.DataFrame, repeats=3):
|
| 152 |
def p_op():
|
| 153 |
-
_ = df.
|
| 154 |
|
| 155 |
p_stats = time_function(p_op, repeats)
|
| 156 |
|
|
@@ -158,7 +158,7 @@ def bench_groupby(df: pd.DataFrame, repeats=3):
|
|
| 158 |
if HAS_POLARS:
|
| 159 |
pl_df = pl.from_pandas(df)
|
| 160 |
def pl_op():
|
| 161 |
-
_ = pl_df.
|
| 162 |
pl_stats = time_function(pl_op, repeats)
|
| 163 |
|
| 164 |
fd_stats = None
|
|
@@ -166,7 +166,7 @@ def bench_groupby(df: pd.DataFrame, repeats=3):
|
|
| 166 |
try:
|
| 167 |
fd_df = ensure_fireducks_from_pandas(df)
|
| 168 |
def fd_op():
|
| 169 |
-
res = fd_df.
|
| 170 |
_ = materialize_fireducks(res)
|
| 171 |
fd_stats = time_function(fd_op, repeats)
|
| 172 |
except Exception:
|
|
|
|
| 150 |
|
| 151 |
def bench_groupby(df: pd.DataFrame, repeats=3):
|
| 152 |
def p_op():
|
| 153 |
+
_ = df.group_by("category")[["value1", "value2"]].mean()
|
| 154 |
|
| 155 |
p_stats = time_function(p_op, repeats)
|
| 156 |
|
|
|
|
| 158 |
if HAS_POLARS:
|
| 159 |
pl_df = pl.from_pandas(df)
|
| 160 |
def pl_op():
|
| 161 |
+
_ = pl_df.group_by("category").agg([pl.col("value1").mean(), pl.col("value2").mean()]).to_pandas()
|
| 162 |
pl_stats = time_function(pl_op, repeats)
|
| 163 |
|
| 164 |
fd_stats = None
|
|
|
|
| 166 |
try:
|
| 167 |
fd_df = ensure_fireducks_from_pandas(df)
|
| 168 |
def fd_op():
|
| 169 |
+
res = fd_df.group_by("category")[["value1", "value2"]].mean()
|
| 170 |
_ = materialize_fireducks(res)
|
| 171 |
fd_stats = time_function(fd_op, repeats)
|
| 172 |
except Exception:
|