Back to list
eyadsibai

dask

by eyadsibai

0🍴 0📅 Jan 15, 2026

SKILL.md


name: dask description: Use when "Dask", "parallel computing", "distributed computing", "larger than memory", or asking about "parallel pandas", "parallel numpy", "out-of-core", "multi-file processing", "cluster computing", "lazy evaluation dataframe" version: 1.0.0

Dask Parallel and Distributed Computing

Scale pandas/NumPy workflows beyond memory and across clusters.

When to Use

  • Datasets exceed available RAM
  • Need to parallelize pandas or NumPy operations
  • Processing multiple files efficiently (CSVs, Parquet)
  • Building custom parallel workflows
  • Distributing workloads across multiple cores/machines

Dask Collections

CollectionLikeUse Case
DataFramepandasTabular data, CSV/Parquet
ArrayNumPyNumerical arrays, matrices
BaglistUnstructured data, JSON logs
DelayedCustomArbitrary Python functions

Key concept: All collections are lazy—computation happens only when you call .compute().


Lazy Evaluation

FunctionBehaviorUse
dd.read_csv()Lazy loadLarge CSVs
dd.read_parquet()Lazy loadLarge Parquet
OperationsBuild graphChain transforms
.compute()ExecuteGet final result

Key concept: Dask builds a task graph of operations, optimizes it, then executes in parallel. Call .compute() once at the end, not after every operation.


Schedulers

SchedulerBest ForStart
threadedNumPy/Pandas (releases GIL)Default
processesPure Python (GIL bound)scheduler='processes'
synchronousDebuggingscheduler='synchronous'
distributedMonitoring, scaling, clustersClient()

Distributed Scheduler

FeatureBenefit
DashboardReal-time progress monitoring
Cluster scalingAdd/remove workers
Fault toleranceRetry failed tasks
Worker resourcesMemory management

Chunking Concepts

DataFrame Partitions

ConceptDescription
PartitionSubset of rows (like a mini DataFrame)
npartitionsNumber of partitions
divisionsIndex boundaries between partitions

Array Chunks

ConceptDescription
ChunkSubset of array (n-dimensional block)
chunksTuple of chunk sizes per dimension
Optimal size~100 MB per chunk

Key concept: Chunk size is critical. Too small = scheduling overhead. Too large = memory issues. Target ~100 MB.


DataFrame Operations

Supported (parallel)

CategoryOperations
Selectionfilter, loc, column selection
Aggregationgroupby, sum, mean, count
Transformsapply (row-wise), map_partitions
Joinsmerge, join (shuffles data)
I/Oread_csv, read_parquet, to_parquet

Avoid or Use Carefully

OperationIssueAlternative
iterrowsKills parallelismmap_partitions
apply(axis=1)Slowmap_partitions
Repeated compute()InefficientSingle compute() at end
sort_valuesExpensive shuffleAvoid if possible

Common Patterns

ETL Pipeline

  1. scan_* or read_* (lazy load)
  2. Chain filters and transforms
  3. Single .compute() or .to_parquet()

Multi-File Processing

PatternDescription
Glob patternsdd.read_csv('data/*.csv')
Partition per fileNatural parallelism
Output partitionedto_parquet('output/')

Custom Operations

MethodUse Case
map_partitionsApply function to each partition
map_blocksApply function to each array block
delayedWrap arbitrary Python functions

Best Practices

PracticeWhy
Don't load locally firstLet Dask handle loading
Single compute() at endAvoid redundant computation
Use ParquetFaster than CSV, columnar
Match partition to filesOne partition per file
Check task graph sizelen(ddf.__dask_graph__()) < 100k
Use distributed for debuggingDashboard shows progress

Common Pitfalls

PitfallSolution
Loading with pandas firstUse dd.read_* directly
compute() in loopsCollect all, single compute()
Too many partitionsRepartition to ~100 MB each
Memory errorsReduce chunk size, add workers
Slow shufflesAvoid sorts/joins when possible

vs Alternatives

ToolBest ForTrade-off
DaskScale pandas/NumPy, clustersSetup complexity
PolarsFast in-memoryMust fit in RAM
VaexOut-of-core single machineLimited operations
SparkEnterprise, SQL-heavyInfrastructure

Resources

Score

Total Score

50/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon