agentleFS
G1JoshiG1Joshi/Agent-Skills/skills/ai-ml/jupyter/SKILL.md

jupyter

Skill15 starsChanged 45 days agoMITView on GitHub

Expert Jupyter Notebook assistance covering interactive Python, kernels, ipywidgets, magic commands, and reproducible data science. Use when prototyping data analysis, ML experiments, and interactive visualizations.

  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use ipywidgets.interact for live sliders:

    line 106
  2. Very specific:

    Use nbstripout or jupytext in Git hooks to avoid committing huge binary outputs and image outputs.

    line 128
  3. Distinctive:

    Leave notebooks with out-of-order execution states (e.g.

    line 134
  4. Distinctive:

    Commit sensitive database passwords, cloud tokens, or API keys inside notebook output cells.

    line 135
  5. Distinctive:

    Use Jupyter notebooks for complex long-running production services.

    line 136

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Jupyter

Jupyter provides the standard interactive computing architecture for data science and machine learning, featuring reproducible notebook workflows, interactive widgets, and polyglot kernels.

When to Use

  • Exploratory Data Analysis (EDA): Interactive data investigation, statistical analysis, and visual storytelling.
  • Machine Learning Experimentation: Rapidly prototyping model architectures, training loops, and loss visualizations.
  • Interactive Technical Reports & Teaching: Combining executable Python/R/Julia code, rich Markdown, LaTeX, and charts.
  • Automated Batch Notebook Execution: Executing parameterized notebooks in production pipelines with Papermill.

Quick Start

# Install and launch JupyterLab
pip install jupyterlab
jupyter lab --port 8888
# Useful built-in cell magics
%%time
import numpy as np
arr = np.random.randn(1000, 1000)
eig = np.linalg.eigvals(arr)

Core Concepts

Essential IPython Magic Commands

Optimizing execution, timing, and module reloading:

# Automatically reload imported modules when modified on disk
%load_ext autoreload
%autoreload 2

# Measure execution time of a single statement
%timeit [i**2 for i in range(1000)]

# Profile execution time of an entire cell
%%time
import numpy as np
arr = np.random.rand(5000, 5000)
eigvals = np.linalg.eigvals(arr)

# Render Matplotlib plots inline with high DPI
%matplotlib inline
%config InlineBackend.figure_format = 'retina'

Interactive UI Widgets with ipywidgets

Building interactive parameter tuning controls inside the notebook:

import ipywidgets as widgets
from IPython.display import display
import matplotlib.pyplot as plt
import numpy as np

def plot_sine_wave(frequency=1.0, amplitude=1.0):
    x = np.linspace(0, 10, 500)
    y = amplitude * np.sin(frequency * x)

    plt.figure(figsize=(8, 3))
    plt.plot(x, y, color='#2563eb', lw=2)
    plt.ylim(-3, 3)
    plt.grid(True, alpha=0.3)
    plt.title(f"Sine Wave: freq={frequency}, amp={amplitude}")
    plt.show()

# Connect function to interactive slider widgets
widgets.interact(
    plot_sine_wave,
    frequency=widgets.FloatSlider(value=1.0, min=0.1, max=5.0, step=0.1),
    amplitude=widgets.FloatSlider(value=1.0, min=0.1, max=3.0, step=0.1)
);

Parameterized Execution with Papermill

Running notebooks programmatically in production data workflows:

# Execute notebook from command line with custom parameters
papermill monthly_report.ipynb output_report.ipynb \
  -p customer_region "EMEA" \
  -p fiscal_year 2026 \
  -p threshold_amount 50000.0

Common Patterns

Interactive Parameter Tuning with ipywidgets

Problem: Manually re-running notebook cells with different hyperparameter values is slow and tedious.

Solution: Use ipywidgets.interact for live sliders:

from ipywidgets import interact
import matplotlib.pyplot as plt
import numpy as np

@interact(frequency=(1.0, 10.0, 0.5), amplitude=(0.5, 3.0, 0.2))
def plot_wave(frequency=2.0, amplitude=1.0):
    t = np.linspace(0, 1, 500)
    y = amplitude * np.sin(2 * np.pi * frequency * t)
    plt.figure(figsize=(8, 3))
    plt.plot(t, y)
    plt.ylim(-3.5, 3.5)
    plt.show()

Best Practices

Do:

  • Restart kernel and run all cells (Kernel -> Restart and Run All) before committing to verify reproducibility.
  • Use nbstripout or jupytext in Git hooks to avoid committing huge binary outputs and image outputs.
  • Move complex, reusable functions from notebook cells into tested .py modules and import them.
  • Configure %config InlineBackend.figure_format = 'retina' for crisp charts on high-DPI displays.

Don't:

  • Leave notebooks with out-of-order execution states (e.g. In [45] before In [2]).
  • Commit sensitive database passwords, cloud tokens, or API keys inside notebook output cells.
  • Use Jupyter notebooks for complex long-running production services; export production logic to scripts/packages.

Troubleshooting

ErrorCauseSolution
No module named '...' in notebook cellNotebook running in different Python kernel/environment than active shell.Install ipykernel in target venv: python -m ipykernel install --user --name myenv.
Kernel died, restartingProcess ran out of RAM or triggered C/C++ segmentation fault.Monitor system RAM usage and downsample large datasets before plotting.
IFrame / Widget Javascript errorJupyterLab extension not enabled or version mismatch.Run jupyter lab build or install compatible widget extensions.

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.