MCPInstall

jupyter-notebook-analysis

Best practices for creating comprehensive Jupyter notebook data analyses with statistical rigor, outlier handling, and publication-quality visualizations. Includes Claude API image size helpers.

Installs
84
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/delphine-l/claude_global --skill jupyter-notebook-analysis
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads jupyter-notebook-analysis automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Jupyter Notebook Analysis Patterns

Expert knowledge for creating comprehensive, statistically rigorous Jupyter notebook analyses.

When to Use This Skill

  • Creating multi-cell Jupyter notebooks for data analysis
  • Adding correlation analyses with statistical testing
  • Implementing outlier removal strategies
  • Building series of related visualizations (10+ figures)
  • Analyzing large datasets with multiple characteristics
  • Building data update/enrichment notebooks with multi-source merging
  • Generating figures for sharing with Claude or other AI tools

Important: Image Size Constraints

When generating images to share with Claude, images must not exceed 8000 pixels in either dimension. Add this helper to your notebook imports:

# Standard imports with Claude size checking
import matplotlib.pyplot as plt
import seaborn as sns
from PIL import Image

MAX_CLAUDE_DIM = 7999  # Claude API limit with safety margin

def save_figure(filename, dpi=300, **kwargs):
    """Save figure with automatic Claude size constraint check."""
    plt.savefig(filename, dpi=dpi, bbox_inches='tight', **kwargs)

    # Verify and auto-resize if needed
    img = Image.open(filename)
    if img.width > MAX_CLAUDE_DIM or img.height > MAX_CLAUDE_DIM:
        print(f"Auto-resizing {filename} for Claude compatibility")
        print(f"   Original: {img.width}x{img.height}")
        img.thumbnail((MAX_CLAUDE_DIM, MAX_CLAUDE_DIM), Image.Resampling.LANCZOS)
        img.save(filename)
        print(f"   Resized: {img.width}x{img.height}")
    else:
        print(f"OK {filename}: {img.width}x{img.height}")

# Safe figure sizes for Claude (300 DPI)
FIG_SIZES = {
    'small': (7, 5),       # 2100x1500 px
    'medium': (12, 9),     # 3600x2700 px
    'large': (20, 15),     # 6000x4500 px
    'max': (26, 26),       # 7800x7800 px - maximum safe
}

# Use in notebook
fig, ax = plt.subplots(figsize=FIG_SIZES['medium'])
# ... plotting code ...
save_figure('figure.png')

For complete image size guidance, see the data-visualization skill.

Core Notebook Patterns

Data Update/Enrichment Notebooks

Use structured notebook patterns for multi-source data merging and enrichment. Key principles:

  1. Configuration section at top with safety defaults (ENABLE_AWS_FETCH = False, TEST_MODE = True)
  2. Composite keys for complex merge uniqueness requirements
  3. Conflict resolution with configurable strategy (NEW vs OLD priority)
  4. Idempotent column addition -- check if columns exist before adding
  5. Enrichment tracking -- count what was actually saved, not just fetched
  6. Two-stage file workflow -- input file -> distinct output file (never in-place)

For detailed patterns including data update, enrichment, and AWS GenomeArk workflows, see notebook-patterns.md.

Notebook Editing

Always use NotebookEdit tool for .ipynb file modifications -- never the Edit tool (corrupts JSON structure).

Three modes: replace (update cell content), insert (add new cell after target), delete (remove cell).

Key rules:

  • Always specify cell_type when inserting
  • Find cell IDs with jq or Python JSON parsing
  • After programmatic edits, instruct user to "Restart & Run All"
  • Update in dependency order when changing metrics across cells

For NotebookEdit usage, programmatic JSON manipulation, bulk operations, and cell newline handling, see notebook-editing.md.

Statistical Methods

Required for All Correlation Analyses

  1. Pearson correlation with p-values using scipy.stats.pearsonr
  2. Report r, p-value, and n on every correlation plot
  3. Mann-Whitney U test for group comparisons

Outlier Handling

  • Stage 1: Count-based outliers (IQR method) -- remove before analysis
  • Stage 2: Value-based outliers (percentile) -- apply only to visualization, not statistics
  • Apply characteristic-specific outlier removal separately per analysis
  • Always report number of outliers removed

Statistical Claim Verification (CRITICAL)

BEFORE finalizing any analysis notebook, verify ALL statistical claims against actual computed values. Text claims can become stale after data/code updates. Extract claims, rerun tests, create verification table.

For detailed statistical methods, outlier removal code, claim verification workflow, and confounding analysis, see statistical-methods.md.

Publication-Quality Figures

Key Standards

  • DPI: 300 for publication, 150 for digital viewing
  • Font sizes: Title 18pt bold, axis labels 16pt bold, ticks 14pt, legend 12pt
  • Colors: Use colorblind-safe palettes (IBM/Okabe-Ito). Blue #0173B2 + Orange #DE8F05 for two-group comparisons
  • Data imbalance: Add prominent warnings when sample size ratio > 5x

Image Display

  • Use HTML <img> tags in markdown cells for responsive SVG/PNG scaling
  • Crop SVGs by modifying viewBox attributes directly (no ImageMagick needed)
  • Manage DPI to prevent "Output too large" errors (use 150 DPI default)

For detailed font size tables, color palette code, imbalance handling, SVG manipulation, and DPI management, see visualization-guide.md.

Notebook Organization

Large Notebooks (60+ cells)

  • Use markdown section headers with cell pairing pattern
  • Consistent naming for figures, variables, and functions
  • Progressive enhancement from basic to complex analyses

Dual-Notebook System

For analyses with 5+ figures preparing for publication:

  • Code notebook: Executable analysis, figure generation, statistical tests
  • Presentation notebook: Figure displays, captions, interpretations, methods

Splitting and Deprecation

When splitting notebooks, recreate all calculated columns and variable definitions in each split. When deprecating, create dated directories with documentation.

For figure usage analysis, splitting strategies, dual-notebook workflow, publication notebook structure, TOC generation, deprecation workflow, and migration guides, see notebook-organization.md.

Sharing and Export

Key Rules

  • Preserve outputs when preparing sharing packages (outputs ARE the documentation)
  • Use relative paths (never absolute) for portability
  • HTML export is best for sharing (self-contained, no software needed)
  • Update paths programmatically when moving notebooks to subdirectories

For path management, HTML/PDF/LaTeX export, sharing package structure, and output preservation guidelines, see sharing-and-export.md.

Template and Helper Patterns

Template Generation

For creating multiple similar analysis cells:

template = '''
if len(data_with_species) > 0:
    print('Analyzing {display} vs {metric}...\\n')
    species_data = {{}}
    for inv in data_with_species:
        {name} = safe_float_convert(inv.get('{name}'))
        if {name} is None:
            continue
        # ... analysis code
'''

characteristics = [
    {'name': 'genome_size', 'display': 'Genome Size', 'unit': 'Gb'},
    {'name': 'heterozygosity', 'display': 'Heterozygosity', 'unit': '%'},
]

for char in characteristics:
    code = template.format(**char)

Helper Function Pattern

Define once, reuse throughout:

def safe_float_convert(value):
    """Convert string to float, handling comma separators"""
    if not value or not str(value).strip():
        return None
    try:
        return float(str(value).replace(',', ''))
    except (ValueError, TypeError):
        return None

Troubleshooting

Key pitfalls to watch for:

  • Variable shadowing: Never use data as a loop variable (shadows global)
  • Column name mismatches: Always print df.columns.tolist() before processing
  • Cell execution order: After NotebookEdit inserts, "Restart & Run All"
  • Notebook size: Use jq for notebooks > 256 KB

For detailed troubleshooting, variable validation, debugging techniques, and environment setup, see troubleshooting.md.

Best Practices Summary

  1. Always check data availability before creating analyses
  2. Document outlier removal clearly in titles and comments
  3. Use consistent naming for variables and figures
  4. Include statistical testing for all correlations
  5. Separate visualization from statistics when filtering outliers
  6. Create templates for repetitive analyses
  7. Use helper functions consistently across cells
  8. Organize with markdown headers for navigation
  9. Test with small datasets before running full analyses
  10. Save intermediate results for expensive computations
  11. Use NotebookEdit tool for all .ipynb file modifications

Supporting Files Reference

FileContents
notebook-patterns.mdData update, enrichment, AWS GenomeArk patterns
notebook-editing.mdNotebookEdit tool, programmatic manipulation, metrics updates
visualization-guide.mdPublication figures, colors, image display, SVG, DPI
statistical-methods.mdOutlier handling, statistical rigor, claim verification
notebook-organization.mdSplitting, dual-notebook, deprecation, figure analysis
sharing-and-export.mdPaths, HTML/PDF export, sharing packages
troubleshooting.mdCommon pitfalls, debugging, validation, environment

FAQ

What does the jupyter-notebook-analysis skill do?

Best practices for creating comprehensive Jupyter notebook data analyses with statistical rigor, outlier handling, and publication-quality visualizations. Includes Claude API image size helpers.

How do I install jupyter-notebook-analysis?

Run npx skills add https://github.com/delphine-l/claude_global --skill jupyter-notebook-analysis in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/jupyter-notebook-analysis/ (personal) or .claude/skills/jupyter-notebook-analysis/ (project).

Which AI agents can use jupyter-notebook-analysis?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is jupyter-notebook-analysis safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains jupyter-notebook-analysis?

It is published by delphine-l in delphine-l/claude_global. It has 84 recorded installs.

More from delphine-l/claude_global

View all →

token-efficiency

delphine-l/claude_global

Token optimization best practices for cost-effective Claude Code usage. Automatically applies efficient file reading, command execution, and output handling strategies. Includes model selection guidance (Opus for learning, Sonnet for development/debugging). Prefers bash commands over reading files.

bioinformatics-fundamentals

delphine-l/claude_global

Open the skill to read its SKILL.md instructions.

folder-organization

delphine-l/claude_global

Open the skill to read its SKILL.md instructions.

148 installs

bioinformatics-visualization

delphine-l/claude_global

Open the skill to read its SKILL.md instructions.

obsidian

delphine-l/claude_global

Integration with Obsidian vault for managing notes, tasks, and knowledge when working with Claude. Supports adding notes, creating tasks, and organizing project documentation. Updated with 2025-2026 best practices including MOCs, properties, practical organization patterns, and Obsidian CLI (1.12+).

managing-environments

delphine-l/claude_global

Best practices for managing development environments including Python venv and conda. Always check environment status before installations and confirm with user before proceeding.

Popular backend & apis skills

View category →

find-skills

vercel-labs/skills

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

OfficialBackend & APIs4.1M installs

entra-app-registration

microsoft/azure-skills

Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.

OfficialBackend & APIs566.7K installs

This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management" — in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).

Backend & APIs514.8K installs

embedded-captions

heygen-com/hyperframes

Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet anchor rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.

Backend & APIs453.3K installs

entra-agent-id

microsoft/azure-skills

Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant) including the Microsoft Entra SDK for AgentID sidecar. USE FOR: Agent Identity Blueprint, BlueprintPrincipal, agent OAuth, fmipath token exchange, agent OBO, Workload Identity Federation for agents, polyglot agent auth, Microsoft.Identity.Web.AgentIdentities. DO NOT USE FOR: standard Entra app registration (use entra-app-registration), Microsoft Foundry agent authoring (use microsoft-foundry).

OfficialBackend & APIs336.6K installs

neon

neondatabase/agent-skills

Overview of Neon, a complete set of cloud backend primitives around Lakebase Postgres: Auth, Object Storage, Functions, the AI Gateway, and Realtime. Start here to choose Neon for undecided login, files, APIs, and LLM calls, set up the CLI or MCP server, and follow the branch-first workflow. Use when building an app or backend on Neon, or when "Neon" or "Lakebase Postgres" is mentioned. Child skill neon-postgres wins for an existing DATABASEURL, SQL, schema, inspect, or search. Child skill neon-auth wins for login, users, sessions, identity routing, and Managed Better Auth setup. Child skill neon-realtime wins for live queries in reactive apps and agents. Also use for object storage, S3, buckets, serverless functions, function triggers, cron, AI gateway, LLM calls, realtime, logs, Loki, Grafana, observability, postgres, database, backend, Claimable Neon, neon.new, or a no-signup database.

Backend & APIs237.1K installs