Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Mar 19, 2024
1 parent 1c55212 commit 1d614da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion narwhals/pandas_like/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def evaluate_simple_aggregation(expr: PandasExpr, grouped: Any, keys: list[str])
"""
if expr._depth == 0:
# e.g. agg(pl.len())
df = getattr(grouped, expr._function_name)()
df = getattr(grouped, expr._function_name.replace("len", "size"))()
df = df.drop(columns=keys) if len(df.shape) > 1 else df.to_frame("size")
return df.rename(columns={"size": expr._output_names[0]}) # type: ignore[index]
if expr._root_names is None or expr._output_names is None:
Expand Down

0 comments on commit 1d614da

Please sign in to comment.