Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14126

Polars aggregate without a groupby

$
0
0

Is there a way to call .agg() without grouping first? I want to perform standard aggregations but only want one row in the response, rather than separate rows for separate groups.

I could do something like

df.with_columns(dummy_col=pl.lit("dummy_col")).group_by('dummy_col').agg(<aggregateion>)

but I'm wondering if there's a way without the dummy stuff


Viewing all articles
Browse latest Browse all 14126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>