Scientific computing library for Python covering optimization, integration, interpolation, linear algebra, signal processing, statistics, and image processing built on NumPy with highly-optimized Fortran/C/C++ backends. Use when building Python programs requiring numerical computations, scientific analysis, engineering calculations, or statistical modeling.
Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
Scientific computing library for Python covering optimization, integration, interpolation, linear algebra, signal processing, statistics, and image processing built on NumPy with highly-optimized Fortran/C/C++ backends. Use when building Python programs requiring numerical computations, scientific analysis, engineering calculations, or statistical modeling.
SciPy 1.17
Overview
SciPy (pronounced "Sigh Pie") is an open-source library of mathematical algorithms and convenience functions built on NumPy. It extends NumPy with significant power for mathematics, science, and engineering by providing high-level commands and classes for manipulating and visualizing data. SciPy wraps highly-optimized implementations written in Fortran, C, and C++, giving Python the flexibility of a scripting language with the speed of compiled code.
SciPy is organized into subpackages covering different scientific computing domains. The library is distributed under a liberal BSD license and developed publicly on GitHub by a vibrant, responsive community.
Version 1.17.1 is a bug-fix release (February 2026) for the 1.17 series. It requires Python 3.11-3.14 and NumPy 1.26.4+. Key highlights of the 1.17 series include native batching support for N-dimensional arrays across many functions, ARPACK/PROPACK ported from Fortran77 to C with external PRNG support, COO sparse array indexing in nD, Rotation/RigidTransform extended to N-D arrays, new matrix_t and Logistic distributions in stats, and initial ILP64 (64-bit integer) BLAS/LAPACK support.
When to Use
Solving optimization problems (unconstrained, constrained, least-squares, linear programming)
Numerical integration of functions and solving ordinary differential equations
Interpolating data in 1D, 2D, or N-D (splines, grid interpolation, radial basis functions)
Subpackage organization: SciPy is organized into focused subpackages. Each subpackage covers a specific domain of scientific computing and should be as self-contained as possible with minimal cross-dependencies. A dependency on NumPy is always assumed.
Import convention: Use namespace imports rather than direct function imports:
import scipy
result = scipy.optimize.curve_fit(...)
# orfrom scipy import optimize
result = optimize.curve_fit(...)
For scipy.io, prefer import scipy because io conflicts with the Python stdlib module of the same name.
Lazy loading: SciPy uses lazy loading — modules are only loaded into memory when first accessed. This means import scipy is fast; submodules load on demand.
Public API: Names starting with underscore _ are private. Submodules listed in the API reference are public and stable across releases. When a submodule defines __all__, that authoritatively defines its public interface.
NumPy foundation: All SciPy routines expect NumPy arrays as input and return NumPy arrays (or compatible array types). The library builds on NumPy's n-dimensional array computing capabilities.
Array API standard: Many SciPy functions now support the Python Array API standard, enabling dispatch to different backends including GPU arrays.
Installation / Setup
SciPy is installed via pip or conda:
pip install scipy==1.17.1
# or
conda install scipy=1.17.1
Requires Python 3.11-3.14 and NumPy 1.26.4+. Pre-built binaries are available for most platforms. When building from source, Meson is used as the build system (replacing the legacy setup.py).
Usage Examples
import numpy as np
from scipy import optimize, integrate, stats, linalg
# Optimization: minimize the Rosenbrock functiondefrosen(x):
returnsum(100.0 * (x[1:] - x[:-1]**2.0)**2.0 + (1 - x[:-1])**2.0)
x0 = np.array([1.3, 0.7, 0.8, 1.9, 1.2])
result = optimize.minimize(rosen, x0, method='BFGS')
print(result.x) # [1. 1. 1. 1. 1.]# Integration: integrate a Bessel functionfrom scipy import special
value, error = integrate.quad(lambda x: special.jv(2.5, x), 0, 4.5)
print(value) # ~1.1178# Statistics: fit a normal distribution to data
data = np.random.randn(1000)
loc, scale = stats.norm.fit(data)
# Linear algebra: solve Ax = b
A = np.array([[3, 1], [1, 2]])
b = np.array([9, 8])
x = linalg.solve(A, b)
Advanced Topics
Optimization: Local and global minimization, root finding, least-squares, linear programming → Optimization
Integration & ODEs: Numerical quadrature, multiple integration, initial value problems, boundary value problems → Integration