Skip to content

Instantly share code, notes, and snippets.

@ntabris
Last active January 31, 2025 23:56
Show Gist options
  • Save ntabris/9040c82536b31f4b287542e94b72c878 to your computer and use it in GitHub Desktop.
Save ntabris/9040c82536b31f4b287542e94b72c878 to your computer and use it in GitHub Desktop.
dask_local_tcp.py
from dask.distributed import Client
client = Client("tcp://127.0.0.1:8786")
print(client)
import dask
# generate random timeseries of data
df = dask.datasets.timeseries(
"1980", "2005", partition_freq="2w"
).persist()
# perform a groupby with an aggregation
result = df.groupby("name").aggregate({"x": "sum", "y": "max"}).compute()
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment