ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

SciPy

Solve optimization, statistics, signal processing, and linear algebra problems with SciPy recipes and ready-to-run code.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/ivangdavila/scipy
Or

Setup

On first use, read setup.md for guidance on how to help the user effectively.

When to Use

User needs scientific computing in Python: optimization, curve fitting, statistical tests, signal processing, interpolation, integration, or linear algebra. Agent provides working code, not theory.

Architecture

This skill is stateless — no persistent storage needed. All code runs in user's Python environment.

See memory-template.md for optional preference tracking.

Quick Reference

TopicFile
Usage guidancesetup.md
Optional preferencesmemory-template.md

Core Rules

1. Working Code First

Every response includes runnable code. No pseudocode, no "implement this yourself".

# Always include imports
from scipy import optimize
import numpy as np

# Complete, working example
result = optimize.minimize(lambda x: x**2, x0=1.0)
print(f"Minimum at x={result.x[0]:.4f}")

2. Module Selection Guide

ProblemModuleKey Function
Find minimum/maximumscipy.optimizeminimize, minimize_scalar
Curve fittingscipy.optimizecurve_fit
Root findingscipy.optimizeroot, brentq, fsolve
Statistical testsscipy.statsttest_ind, chi2_contingency
Distributionsscipy.statsnorm, poisson, expon
Filter signalsscipy.signalbutter, filtfilt, savgol_filter
FFTscipy.fftfft, ifft, fftfreq
Interpolationscipy.interpolateinterp1d, UnivariateSpline
Integrationscipy.integratequad, solve_ivp
Linear algebrascipy.linalgsolve, eig, svd
Sparse matricesscipy.sparsecsr_matrix, linalg.spsolve
Spatial datascipy.spatialKDTree, distance
Image processingscipy.ndimagegaussian_filter, label

3. Explain Key Parameters

When code uses non-obvious parameters, explain why:

# method='L-BFGS-B' for bounded optimization
# bounds prevent physically impossible values
result = optimize.minimize(
    objective, x0, 
    method='L-BFGS-B',
    bounds=[(0, None), (0, 100)]  # x1 >= 0, 0 <= x2 <= 100
)

4. Validate Results

Always include sanity checks:

result = optimize.minimize(func, x0)
if not result.success:
    print(f"⚠️ Optimization failed: {result.message}")
else:
    print(f"✓ Converged in {result.nit} iterations")

5. NumPy Integration

SciPy builds on NumPy. Use vectorized operations:

# ✓ Vectorized (fast)
x = np.linspace(0, 10, 1000)
y = np.sin(x)

# ✗ Loop (slow)
y = [np.sin(xi) for xi in x]

Optimization Patterns

Minimize a Function

from scipy.optimize import minimize
import numpy as np

# Rosenbrock function (classic test)
def rosenbrock(x):
    return sum(100*(x[1:]-x[:-1]**2)**2 + (1-x[:-1])**2)

x0 = np.array([0, 0])
result = minimize(rosenbrock, x0, method='BFGS')

Metadata

Stars2102
Views0
Updated2026-03-06
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-ivangdavila-scipy": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.