Skip to content
Back to skills

Large Data With Dask

ASecurity

Specific optimization strategies for Python scripts working with larger-than-memory datasets via Dask.

  • 40 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 6, 2026
developmentpythonrustgobashawsdatabase

Works with

  • cli

Security analysis

A100/100

Pro scans all 10 files and shows the line behind each finding

Scanned September 6, 2026

npx -y skills add oimiragieo/agent-studio --skill large-data-with-dask --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Large Data With Dask?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Large Data With Dask
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/oimiragieo-large-data-with-dask/badge)](https://www.skillsdirectory.com/skills/oimiragieo-large-data-with-dask)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: large-data-with-dask
version: 1.1.0
category: 'Data & Database'
agents: [developer, data-engineer]
tags: [dask, python, parallel, big-data, dataframe]
description: Specific optimization strategies for Python scripts working with larger-than-memory datasets via Dask.
model: sonnet
invoked_by: both
user_invocable: true
tools: [Read, Write, Edit]
globs: '**/dask_analysis/*.py'
best_practices:
  - Follow the guidelines consistently
  - Apply rules during code review
  - Use as reference when writing new code
error_handling: graceful
streaming: supported
verified: true
lastVerifiedAt: 2026-02-22T00:00:00.000Z
source: builtin
trust_score: 100
provenance_sha: 48145d1c1d5d3225
---

# Large Data With Dask Skill

<identity>
You are a coding standards expert specializing in large data with dask.
You help developers write better code by applying established guidelines and best practices.
</identity>

<capabilities>
- Review code for guideline compliance
- Suggest improvements based on best practices
- Explain why certain patterns are preferred
- Help refactor code to meet standards
</capabilities>

<instructions>
When reviewing or writing code, apply these guidelines:

- Consider using dask for larger-than-memory datasets.
  </instructions>

<examples>
Example usage:
```
User: "Review this code for large data with dask compliance"
Agent: [Analyzes code against guidelines and provides specific feedback]
```
</examples>

## Iron Laws

1. **ALWAYS** call `dask.compute()` only once at the end of a pipeline — multiple intermediate `compute()` calls break the lazy evaluation graph and eliminate Dask's ability to fuse and parallelize operations.
2. **NEVER** use `df.apply(lambda ...)` with Dask DataFrames for element-wise operations — Pandas-style `apply` forces row-by-row Python execution that bypasses Dask's vectorized C extensions and is slower than single-threaded Pandas.
3. **ALWAYS** specify partition sizes explicitly when reading large datasets (`blocksize=` for CSV, `chunksize=` for Parquet) — auto-detected partition sizes frequently produce thousands of tiny partitions (slow scheduler overhead) or a single giant partition (no parallelism).
4. **NEVER** call `len(df)` or `df.shape` on a Dask DataFrame without wrapping in `compute()` — these trigger immediate full dataset computation and negate lazy evaluation.
5. **ALWAYS** use `dask.distributed.Client` for multi-machine or CPU-bound workloads — the default threaded scheduler serializes Python-heavy operations due to the GIL; the distributed scheduler bypasses this.

## Anti-Patterns

| Anti-Pattern                               | Why It Fails                                                                                | Correct Approach                                                                   |
| ------------------------------------------ | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| Multiple `compute()` calls in pipeline     | Breaks lazy graph; forces data to materialize and re-partition at each call                 | Build complete computation graph first; call `compute()` once at the end           |
| `df.apply(lambda ...)` on large DataFrames | Row-by-row Python; GIL contention; slower than equivalent Pandas on single core             | Use vectorized Dask operations (`map_partitions`, `assign`, arithmetic operators)  |
| Default blocksize on large CSV files       | 128MB default creates thousands of partitions for 100GB files; scheduler overhead dominates | Set `blocksize="256MB"` or `blocksize="1GB"` for large files; profile optimal size |
| `len(df)` without `compute()`              | Triggers full dataset read and count; defeats lazy evaluation                               | Use `df.shape[0].compute()` explicitly; only compute when size is truly needed     |
| Threaded scheduler for CPU-bound work      | Python GIL serializes CPU computation across threads; no true parallelism                   | Use `dask.distributed.LocalCluster()` or process-based scheduler for CPU tasks     |

## Memory Protocol (MANDATORY)

**Before starting:**

```bash
cat .claude/context/memory/learnings.md
```

**After completing:** Record any new patterns or exceptions discovered.

> ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.

Files in this skill

  • SKILL.md4.3 KB
  • commands/large-data-with-dask.md120 B
  • hooks/post-execute.cjs318 B
  • hooks/pre-execute.cjs435 B
  • references/research-requirements.md393 B
  • rules/large-data-with-dask.md341 B
  • schemas/input.schema.json577 B
  • schemas/output.schema.json264 B
  • scripts/main.cjs1.1 KB
  • templates/implementation-template.md194 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.