Zum Inhalt springen
Skillpedia
Analyse & Tabellen51k · #3444

dask

Was er macht

Dask ist ein Tool, mit dem du mit sehr großen Datensätzen arbeiten kannst, die nicht in den Arbeitsspeicher deines Computers passen. Es beschleunigt die Verarbeitung, indem es die Arbeit in kleinere Teile zerlegt und mehrere Prozessorkerne oder sogar mehrere Computer nutzt.

Wann du ihn nutzt

  • ✓Wenn deine Daten größer sind als der RAM deines Computers.
  • ✓Um Berechnungen zu beschleunigen, die Bibliotheken wie Pandas oder NumPy verwenden.
  • ✓Wenn du viele Dateien auf einmal verarbeitest (zum Beispiel CSVs oder Logs).

Link zum Skill

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/dask/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/dask/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Wie kann ich Dask verwenden, um eine 50-GB-CSV-Datei zu analysieren, die nicht in den Arbeitsspeicher passt?”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Dask teilt deine Daten in kleinere Blöcke auf und führt Operationen parallel auf diesen Blöcken aus. Es steuert den Arbeitsablauf und sorgt dafür, dass die Ergebnisse richtig zusammengeführt werden, auch wenn die Daten zu groß sind, um alles auf einmal zu verarbeiten.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

Dask

Overview

Dask is a Python library for parallel and distributed computing that enables three critical capabilities:

  • Larger-than-memory execution on single machines for data exceeding available RAM
  • Parallel processing for improved computational speed across multiple cores
  • Distributed computation supporting terabyte-scale datasets across multiple machines

Capacity depends on partition sizes, intermediate data, concurrency, storage, and available memory.

Reviewed release: dask/distributed 2026.8.0 (September 30, 2026 review). Docs: docs.dask.org. Since 2025.1.0, the expression-based DataFrame API with query planning is the only implementation — do not install dask-expr separately or set dataframe.query-planning: False.

Quick Start

Installation

uv pip install "dask[array,dataframe]==2026.8.0"

For a typical pandas/NumPy workflow with the distributed scheduler and dashboard:

uv pip install "dask[complete]==2026.8.0"

Remote object storage (requires provider credentials for private data):

uv pip install s3fs    # s3:// paths
uv pip install gcsfs   # gs:// paths

Requires Python 3.10+, pandas 2+, PyArrow 16+. Zarr, HDF5, SciPy, Xarray, Dask-ML, and cluster deployment packages are separate optional dependencies. See review and validation for tested versions, source links, and limits. File paths and undefined application functions below are illustrative. Put process scheduler/Client() execution in a main() guarded by if __name__ == "__main__": in scripts; close clients and clusters afterward.

When to Use This Skill

This skill should be used when:

  • Process datasets that exceed available RAM
  • Scale pandas or NumPy operations to larger datasets
  • Parallelize computations for performance improvements
  • Process multiple files efficiently (CSVs, Parquet, JSON, text logs)
  • Build custom parallel workflows with task dependencies
  • Distribute workloads across multiple cores or machines

Core Capabilities

Dask provides five main components, each suited to different use cases:

1. DataFrames - Parallel Pandas Operations

Purpose: Scale pandas operations to larger datasets through parallel processing.

When to Use:

  • Tabular data exceeds available RAM
  • Need to process multiple CSV/Parquet files together
  • Pandas operations are slow and need parallelization
  • Scaling from pandas prototype to production

Reference Documentation: For comprehensive guidance on Dask DataFrames, refer to references/dataframes.md which includes:

  • Reading data (single files, multiple files, glob patterns)
  • Common operations (filtering, groupby, joins, aggregations)
  • Custom operations with map_partitions
  • Performance optimization tips
  • Common patterns (ETL, time series, multi-file processing)

Quick Example:

import dask.dataframe as dd

# Read multiple files as single DataFrame
ddf = dd.read_csv('data/2024-*.csv')

# Operations are lazy until compute()
filtered = ddf[ddf['value'] > 100]
result = filtered.groupby('category')['value'].mean().compute()

Key Points:

  • Operations are lazy (build task graph) until .compute() called
  • Use map_partitions for efficient custom operations
  • Convert to DataFrame early when working with structured data from other sources

2. Arrays - Parallel NumPy Operations

Purpose: Extend NumPy capabilities to datasets larger than memory using blocked algorithms.

When to Use:

  • Arrays exceed available RAM
  • NumPy operations need parallelization
  • Working with scientific datasets (HDF5, Zarr, NetCDF)
  • Need parallel linear algebra or array operations

Reference Documentation: For comprehensive guidance on Dask Arrays, refer to references/arrays.md which includes:

  • Creating arrays (from NumPy, random, from disk)
  • Chunking strategies and optimization
  • Common operations (arithmetic, reductions, linear algebra)
  • Custom operations with map_blocks
  • Integration with HDF5, Zarr, and XArray

Quick Example:

import dask.array as da

# Small executable example; size chunks from uncompressed memory before scaling
x = da.random.default_rng(42).random((1000, 1000), chunks=(250, 250))

# Operations are lazy
y = x + 100
z = y.mean(axis=0)

# Compute result
result = z.compute()

Key Points:

  • Chunk size is critical (aim for ~100 MiB per chunk, adjusted to memory and operation)

…

Häufige Fragen

Was sind „Chunks“?

Chunks (Blöcke) sind die kleineren Teile, in die Dask deine Daten für die Verarbeitung aufteilt.

Brauche ich mehrere Computer, um Dask zu nutzen?

Nicht unbedingt. Du kannst Dask auf einem einzelnen Computer nutzen, um Daten zu verarbeiten, die größer als der Arbeitsspeicher sind, oder um Berechnungen zu beschleunigen, indem du die Arbeit auf die Prozessorkerne verteilst.

Ersetzt Dask Pandas und NumPy?

Nein, Dask erweitert Pandas und NumPy. Es verwendet dieselbe vertraute Syntax, erlaubt dir aber, mit größeren Daten und parallel zu arbeiten.

Details

Originalbeschreibung des Autors

Scales pandas, NumPy, and custom Python research workflows beyond memory or across clusters with Dask. Covers DataFrames, Arrays, Bags, Futures, chunking, schedulers, and distributed diagnostics. Use for partitioned file processing, scientific array computation, or parallel tasks whose memory and dependency structure require Dask.

repo: K-Dense-AI/scientific-agent-skills

Beliebtheit

GitHub-Sterne
51k
Platz im Ranking
#3444
Lizenz
MIT
Aktualisiert
15.10.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills