Skip to content

created aggregations notebook#45

Closed
jorammutenge wants to merge 4 commits intomarimo-team:mainfrom
jorammutenge:aggregations
Closed

created aggregations notebook#45
jorammutenge wants to merge 4 commits intomarimo-team:mainfrom
jorammutenge:aggregations

Conversation

@jorammutenge
Copy link
Contributor

@jorammutenge jorammutenge commented Mar 2, 2025

📝 Summary

📋 Checklist

  • I have included package dependencies in the notebook file using --sandbox
  • If adding a course, include a README.md
  • Keep language direct and simple.

Comment on lines +34 to +40
@app.cell
def _():
import polars as pl

df = pl.read_parquet('../data/sales.parquet')
df
return df, pl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd recommend using a hosted URL for the .parquet file instead of having this locally (as I believe it helps save repo space as we add more topics over the course of time). Personally, I'd recommend HuggingFace (polars + HF works great in marimo):

import polars as pl

# Login using e.g. `huggingface-cli login` to access this dataset
df = pl.read_parquet('hf://datasets/<your-username/<filename>.parquet')

Comment on lines +34 to +39
@app.cell
def _():
import polars as pl

df = pl.read_parquet('../data/sales.parquet')
df
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also seem to be running into this error:
[wasm] polars read_parquet raises AttributeError: type object 'builtins.PyLazyFrame' has no attribute 'new_from_parquet'
pola-rs/polars#20876 (ah, raised by @mscolnick)

This occurs when I'm trying to preview the file directly in our WASM playground using:

https://marimo.app/https://github.com/marimo-team/learn/blob/0d99c6780c727ad698b03deef1f4a31ee8141a47/polars/12_aggregations.py

Comment on lines +352 to +355
@app.cell
def _():
return

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just an empty cell here which can be deleted.


@app.cell(hide_code=True)
def _(mo):
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.""")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hyperlinking relevant words in the notebook to the polars docs webpage for easier referencing?

@Haleshot
Copy link
Contributor

Haleshot commented Mar 3, 2025

Visited the notebook via: https://marimo.app/https://github.com/marimo-team/learn/blob/f42618970f1bbc1d04ffc63f2fb813b33e1caf58/polars/12_aggregations.py; seems to load in the WASM playground.

Unchecked the README tickbox in your PR description comment since a README already exists.

Great, crisp notebook overall!

Copy link
Contributor

@Haleshot Haleshot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these two files be removed?
Ah sorry, saw that you raised PR #46 to tackle the above comments.

@jorammutenge jorammutenge deleted the aggregations branch March 4, 2025 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants