Use for Jupyter, JupyterLab, marimo, and Google Colab workflows. Choose this skill when creating, converting, or improving reproducible notebooks for data exploration, analysis, documentation, or teaching.
설치
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
Use for Jupyter, JupyterLab, marimo, and Google Colab workflows. Choose this skill when creating, converting, or improving reproducible notebooks for data exploration, analysis, documentation, or teaching.
Working in Notebooks
Use this skill to create, maintain, and choose between notebook environments (Jupyter, marimo, Colab) for data work. Covers tool selection, reproducibility patterns, and workflow best practices.
When to use this skill
Setting up a notebook environment — choosing between Jupyter, marimo, VS Code, or Colab
Converting between notebook formats — Jupyter to marimo, .ipynb to .py, or vice versa
Making notebooks reproducible — pinning dependencies, managing random seeds, avoiding hardcoded paths
See decision checklist above. If starting fresh and reproducibility matters → marimo. If ecosystem/extensions matter → JupyterLab.
Step 2: Set up the environment
# Cell 1: Environment setup (run first)# Set random seeds for reproducibilityimport numpy as np
import random
np.random.seed(42)
random.seed(42)
# For torch users:# import torch# torch.manual_seed(42)
# With uv
uv pip freeze > requirements.txt
# With poetry
poetry export -f requirements.txt > requirements.txt
Step 4: Structure for readability
# Title: Clear project/question description## Setup
Imports and configuration
## Data Loading
Load and validate data
## Analysis- Subsection per question/hypothesis
- Clear markdown explanations
- Visualizations with interpretations
## Conclusions
Key findings and next steps
Step 5: Never hardcode secrets
# ✅ Use environment variablesimport os
api_key = os.environ.get("OPENAI_API_KEY")
# ❌ Never do this
api_key = "sk-abc123..."
Step 6: Clean outputs before git (Jupyter)
# Install nbstripout
pip install nbstripout
nbstripout --install
# Or use pre-commit
pip install pre-commit
pre-commit install
Validation and feedback loop
Self-check questions
Before considering a notebook "done":
Can someone else run this from a fresh environment?
Are all random seeds set?
Are dependencies pinned (requirements.txt or similar)?
Are secrets loaded from environment variables?
Are cells organized logically (not execution-order dependent)?
Are helper functions extracted to .py files if >30 lines?
Are outputs stripped before committing (if using Jupyter)?
Testing notebook code
See ../analyzing-data/references/notebook-testing.md for:
❌ Running cells out of order (Jupyter) → Use "Run All" to verify, or switch to marimo
❌ Giant cells with mixed concerns → One concept per cell, <50 lines
❌ Hardcoded file paths → Use relative paths or environment variables
❌ Hardcoded secrets → Load from environment
❌ Committing large output files → Use .gitignore, data/ folder, or strip outputs
❌ Inline data → Use data/ folder or external sources
❌ No markdown explanations → Every code block deserves context
Quick commands reference
Jupyter
# Start JupyterLab
jupyter lab
# Convert notebook
jupyter nbconvert notebook.ipynb --to html
jupyter nbconvert notebook.ipynb --to script
# List kernels
jupyter kernelspec list
# Install kernel for virtual environment
python -m ipykernel install --user --name=myenv
marimo
# Create/edit a notebook
marimo edit notebook.py
# Run as app (read-only)
marimo run notebook.py
# Convert from Jupyter
marimo convert notebook.ipynb -o notebook.py
# Export to HTML
marimo export html notebook.py -o notebook.html
Environment validation
# Check installed versionsimport pandas as pd
import numpy as np
print(f"pandas: {pd.__version__}")
print(f"numpy: {np.__version__}")
Related skills
Skill
Relationship
When to use
analyzing-data
Complementary
EDA patterns, profiling, statistical tests—use with notebooks
building-data-apps
Distinct boundary
Building stakeholder-facing dashboards—not this skill
evaluating-ml-models
Complementary
Cross-validation, metrics, experiment tracking
engineering-ml-features
Complementary
Feature engineering patterns and transformations
Migration notes
This skill replaces data-science-notebooks with the following changes:
Removed dependsOn from frontmatter (non-standard field)
Added explicit when-to-use and when-not-to-use sections
Split content into focused reference files
Clear boundary documentation vs building-data-apps
Progressive disclosure with direct file paths (no @skill hybrid syntax)