Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/docs/source/src/python/polars-cloud/index.py
6940 views
1
"""
2
# --8<-- [start:index]
3
import polars as pl
4
import polars_cloud as pc
5
6
ctx = pc.ComputeContext(workspace="your-workspace", cpus=16, memory=64)
7
8
query = (
9
pl.scan_parquet("s3://my-dataset/")
10
.group_by("l_returnflag", "l_linestatus")
11
.agg(
12
avg_price=pl.mean("l_extendedprice"),
13
avg_disc=pl.mean("l_discount"),
14
count_order=pl.len(),
15
)
16
)
17
18
(
19
query.remote(context=ctx)
20
.sink_parquet("s3://my-dst/")
21
)
22
# --8<-- [end:index]
23
"""
24
25