
SciPy
SciPy provides algorithms for optimization, integration, interpolation, eigenvalue problems, algebraic equations, differential equations, statistics and many other classes of problems.
SciPy - Installation
Here is a step-by-step guide to setting up a project to use SciPy, with uv, a Python package manager. Install uv following, the instructions in the uv documentation.
SciPy API — SciPy v1.16.2 Manual
To clarify which modules these are, we define below what the public API is for SciPy, and give some recommendations for how to import modules/functions/objects from SciPy.
Sparse arrays (scipy.sparse) — SciPy v1.16.2 Manual
If you do want to apply a NumPy function to these arrays, first check if SciPy has its own implementation for the given sparse array class, or convert the sparse array to a NumPy array (e.g., using the …
find_peaks — SciPy v1.16.2 Manual
To demonstrate this function’s usage we use a signal x supplied with SciPy (see scipy.datasets.electrocardiogram). Let’s find all peaks (local maxima) in x whose amplitude lies …
minimize — SciPy v1.16.2 Manual
It switches between two implementations depending on the problem definition. It is the most versatile constrained minimization algorithm implemented in SciPy and the most appropriate for large-scale …
Integration (scipy.integrate) — SciPy v1.16.2 Manual
Integration (scipy.integrate) # The scipy.integrate sub-package provides several integration techniques including an ordinary differential equation integrator. An overview of the module is provided by the …
Optimization (scipy.optimize) — SciPy v1.16.2 Manual
Large-scale bundle adjustment in scipy demonstrates large-scale capabilities of least_squares and how to efficiently compute finite difference approximation of sparse Jacobian. Robust nonlinear …
Statistical functions (scipy.stats) — SciPy v1.16.2 Manual
SciPy has many functions for performing hypothesis tests that return a test statistic and a p-value, and several of them return confidence intervals and/or other related information.
linregress — SciPy v1.16.2 Manual
Beginning in SciPy 1.9, np.matrix inputs (not recommended for new code) are converted to np.ndarray before the calculation is performed. In this case, the output will be a scalar or np.ndarray of …