Spaces:
Sleeping
Sleeping
Joram Mutenge
commited on
Commit
·
d340dee
1
Parent(s):
e769793
added links on some notes
Browse files
polars/12_aggregations.py
CHANGED
|
@@ -8,7 +8,7 @@
|
|
| 8 |
|
| 9 |
import marimo
|
| 10 |
|
| 11 |
-
__generated_with = "0.11.
|
| 12 |
app = marimo.App(width="medium")
|
| 13 |
|
| 14 |
|
|
@@ -102,7 +102,7 @@ def _(df, pl):
|
|
| 102 |
|
| 103 |
@app.cell(hide_code=True)
|
| 104 |
def _(mo):
|
| 105 |
-
mo.md(r"""Actually, the way we've been writing the aggregate lines is syntactic sugar. Here's a longer way of doing it as shown in the Polars documentation.""")
|
| 106 |
return
|
| 107 |
|
| 108 |
|
|
@@ -140,7 +140,7 @@ def _(df, pl):
|
|
| 140 |
def _(mo):
|
| 141 |
mo.md(
|
| 142 |
r"""
|
| 143 |
-
Aggregations when grouping data are not limited to sums. You can also use functions like `max`, `min`, `median`, `first`, and `last
|
| 144 |
|
| 145 |
Let's find the largest sale quantity for each product category.
|
| 146 |
"""
|
|
@@ -347,12 +347,7 @@ def _(df, pl):
|
|
| 347 |
|
| 348 |
@app.cell(hide_code=True)
|
| 349 |
def _(mo):
|
| 350 |
-
mo.md(r"""There's more you can do with aggregations in Polars. We hope that in this notebook, we've armed you with the tools to get started.""")
|
| 351 |
-
return
|
| 352 |
-
|
| 353 |
-
|
| 354 |
-
@app.cell
|
| 355 |
-
def _():
|
| 356 |
return
|
| 357 |
|
| 358 |
|
|
|
|
| 8 |
|
| 9 |
import marimo
|
| 10 |
|
| 11 |
+
__generated_with = "0.11.14"
|
| 12 |
app = marimo.App(width="medium")
|
| 13 |
|
| 14 |
|
|
|
|
| 102 |
|
| 103 |
@app.cell(hide_code=True)
|
| 104 |
def _(mo):
|
| 105 |
+
mo.md(r"""Actually, the way we've been writing the aggregate lines is syntactic sugar. Here's a longer way of doing it as shown in the [Polars documentation](https://docs.pola.rs/api/python/stable/reference/dataframe/api/polars.dataframe.group_by.GroupBy.agg.html).""")
|
| 106 |
return
|
| 107 |
|
| 108 |
|
|
|
|
| 140 |
def _(mo):
|
| 141 |
mo.md(
|
| 142 |
r"""
|
| 143 |
+
Aggregations when grouping data are not limited to sums. You can also use functions like [`max`, `min`, `median`, `first`, and `last`](https://docs.pola.rs/user-guide/expressions/aggregation/#basic-aggregations).
|
| 144 |
|
| 145 |
Let's find the largest sale quantity for each product category.
|
| 146 |
"""
|
|
|
|
| 347 |
|
| 348 |
@app.cell(hide_code=True)
|
| 349 |
def _(mo):
|
| 350 |
+
mo.md(r"""There's more you can do with aggregations in Polars such as [sorting with aggregations](https://docs.pola.rs/user-guide/expressions/aggregation/#sorting). We hope that in this notebook, we've armed you with the tools to get started.""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 351 |
return
|
| 352 |
|
| 353 |
|